Question Exporting Formatted Table

MOTOWN44

Registered User.
Local time
Today, 05:53
Joined
Aug 18, 2009
Messages
42
Now then

im exporting one of my tables to a specific folder as an excel doc, im wanting to to automatically format this excel workbook when i press the export button on my form

the code i use to export is

Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Unlocked", "C:\unlocked_10_.xls", True, "Unlocked"
Name "C:\unlocked_10_.xls" As "C:\unlocked_10_" & Format(Date, "yyyymmdd") & ".xls"

i know i need to add somthing along the lines of

Code:
 With
            .Application.Sheets("Unlocked").Select
            .Application.Cells.Select
            .Application.Selection.ClearFormats
            .Application.Rows("1:1").Select
            .Application.Selection.Font.Bold = True
            .Application.Cells.Select
            .Application.Selection.RowHeight = 12.75
            .Application.Selection.Columns.AutoFit
            .Application.Range("A2").Select
            .Application.ActiveWindow.FreezePanes = True
            .Application.Range("A1").Select
            .Application.Selection.AutoFilter
            .Application.ActiveWorkbook.Save
            .Application.ActiveWorkbook.Close
            .Quit
    End With

to the VBA but im unsure how to implement this

could somone give me a hand?

all help welcome
Thanks
 
Use the code entered here to create your own formatting function.

You need to use the Excel Object and open the workbook you just created.
Then add the code you created (between with and end with)

HTH:D
 

Users who are viewing this thread

Back
Top Bottom