A while ago I needed a routine to alter the cell formatting of a client spreadsheet to importing. An EE expert provide the code to do that. This is the code that is passed the spreadsheet name and location:
Private Sub fixSpreadsheetNumFormat(passedNameAndLoc As String)
Dim xlApp As Object, xlWb As Object, xlWs As Object
Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Open(passedNameAndLoc)
Set xlWs = xlWb.Worksheets(1)
xlWs.Range("F:P").NumberFormat = "0"
'repeat as needed
Set xlWs = Nothing
Set xlWb = Nothing
Set xlApp = Nothing
I now need to do something very similar but in this case I want to format the cells on the spreadsheet as 'General', they are currently formatted as 'Date'.
I know the routine above works but I'm not sure how so I don't know how to revise it to accomplish what I need: Here's what I would like it to do:
If possible, starting on Row 6 of the spreadsheet (the first five rows are general info, the data starts on rows 6) for columns A - M, revise the column format to 'General'