J
jonezn
I can use this to open the csv file and autofit/sort it. Now how do you
center the entire sheet not just one cell?
Const xlAscending = 1
Const xlYes = 1
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = _
objExcel.Workbooks.Open("h:\Test.csv")
Set objWorksheet = objWorkbook.Worksheets(1)
Set objRange1 = objWorksheet.UsedRange
Set objRange2 = objExcel.Range("A1")
objRange1.Sort objRange2, xlAscending, , , , , , xlYes
Set objRange = objExcel.Columns("A:K").AutoFit
this line does a cell.
objWorksheet.Cells(1, 7).HorizontalAlignment = -4108
how can you do the entire workbook?
center the entire sheet not just one cell?
Const xlAscending = 1
Const xlYes = 1
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = _
objExcel.Workbooks.Open("h:\Test.csv")
Set objWorksheet = objWorkbook.Worksheets(1)
Set objRange1 = objWorksheet.UsedRange
Set objRange2 = objExcel.Range("A1")
objRange1.Sort objRange2, xlAscending, , , , , , xlYes
Set objRange = objExcel.Columns("A:K").AutoFit
this line does a cell.
objWorksheet.Cells(1, 7).HorizontalAlignment = -4108
how can you do the entire workbook?