hi,
i have code that exports access data (query) into excel. it works ok, but i need to add below a few columns total value (sum). the number of rows is not constant. i am not sure what is the best way to do it. any sugestion, please?
here is my existing code:
...
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "REVENUE DETAIL", Me.Text22, True, "REVENUE"
...
With objXL.Application
.Visible = True
.Workbooks.Open Me.Text22
'Format Worksheets
.Sheets("REVENUE").Select
.Range("A1:V1").Select
.Selection.AutoFormat Format:=xlRangeAutoFormatClassic2, Number:=True, Font _
:=True, Alignment:=True, Border:=True, Pattern:=True, Width:=True
.ActiveWindow.LargeScroll ToRight:=-1
.Columns("U:U").Select
.Selection.NumberFormat = "$#,##0.00"
.Cells.Select
.Cells.EntireColumn.AutoFit
End With
i have code that exports access data (query) into excel. it works ok, but i need to add below a few columns total value (sum). the number of rows is not constant. i am not sure what is the best way to do it. any sugestion, please?
here is my existing code:
...
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "REVENUE DETAIL", Me.Text22, True, "REVENUE"
...
With objXL.Application
.Visible = True
.Workbooks.Open Me.Text22
'Format Worksheets
.Sheets("REVENUE").Select
.Range("A1:V1").Select
.Selection.AutoFormat Format:=xlRangeAutoFormatClassic2, Number:=True, Font _
:=True, Alignment:=True, Border:=True, Pattern:=True, Width:=True
.ActiveWindow.LargeScroll ToRight:=-1
.Columns("U:U").Select
.Selection.NumberFormat = "$#,##0.00"
.Cells.Select
.Cells.EntireColumn.AutoFit
End With