Set Excelapp = CreateObject("Excel.Application")
Set ExcelWorkbook = Excelapp.Workbooks.Add 'Then 1 2 and 3 Sheets
Set ExcelSheet = ExcelWorkbook.Worksheets(1)
ExcelSheet.Name = "All"
Set ExcelSheet2 = ExcelWorkbook.Worksheets(2)
ExcelSheet2.Name = "A"
Set ExcelSheet3 = ExcelWorkbook.Worksheets(3)
ExcelSheet3.Name = "O"
Dim xSheets As Integer
For xSheets = 1 To 3 ' Main Loop.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
With ExcelWorkbook.Worksheets(xSheets)
Excelapp.Range("D1
3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("E1:E3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("F1:F3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("G1:E3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("H1:F3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
'The above works but only formats the 1st Sheet
???how do i use the folowing code to format Sheets 1 , 2 ,3 ...object does not support thsi property or method
.Range("D1
3000").Select
.Selection.NumberFormat = "$#,##0.00"
next
End With
Regards Robert
Set ExcelWorkbook = Excelapp.Workbooks.Add 'Then 1 2 and 3 Sheets
Set ExcelSheet = ExcelWorkbook.Worksheets(1)
ExcelSheet.Name = "All"
Set ExcelSheet2 = ExcelWorkbook.Worksheets(2)
ExcelSheet2.Name = "A"
Set ExcelSheet3 = ExcelWorkbook.Worksheets(3)
ExcelSheet3.Name = "O"
Dim xSheets As Integer
For xSheets = 1 To 3 ' Main Loop.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
With ExcelWorkbook.Worksheets(xSheets)
Excelapp.Range("D1
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("E1:E3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("F1:F3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("G1:E3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
Excelapp.Range("H1:F3000").Select
Excelapp.Selection.NumberFormat = "$#,##0.00"
'The above works but only formats the 1st Sheet
???how do i use the folowing code to format Sheets 1 , 2 ,3 ...object does not support thsi property or method
.Range("D1
.Selection.NumberFormat = "$#,##0.00"
next
End With
Regards Robert