S
sjharri
I have a macro contained in a master spreadsheet which is used to
extract data from a spreadsheet selected by a user, the selected
spreadsheets are listed in the master spreadsheet containing the macro.
The macro opens the selected spreadsheet and formats the data (removes
unwanted cells, adds a header row and numbers it 1,2,3.......) and
outputs it to a csv file, this is then loaded into a sql server
database.
I need to add an update date field as the final field in the csv file,
therefore this should be appended to the final column of data in the
final csv file. I do not want to edit the original spreadsheet selected
by the user.
The final column of data varies between user spreadsheets but I am
identifying what is the final column and inserting a header row up to
the final column using the code:
If sId > 5 Then
LastCol = ActiveSheet.UsedRange.Columns.Count +
ActiveSheet.UsedRange.Column - 1
Rows("1:1").Insert shift:=xlDown
Range("A1").Select
ActiveCell.Value = 1
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(1,
LastCol)), Type:=xlFillSeries
Can I do something like LastCol+1 needs to be autofill with a date
timestamp?
Fairly new to this so excuse my ignorance?
Thanks
Steve
extract data from a spreadsheet selected by a user, the selected
spreadsheets are listed in the master spreadsheet containing the macro.
The macro opens the selected spreadsheet and formats the data (removes
unwanted cells, adds a header row and numbers it 1,2,3.......) and
outputs it to a csv file, this is then loaded into a sql server
database.
I need to add an update date field as the final field in the csv file,
therefore this should be appended to the final column of data in the
final csv file. I do not want to edit the original spreadsheet selected
by the user.
The final column of data varies between user spreadsheets but I am
identifying what is the final column and inserting a header row up to
the final column using the code:
If sId > 5 Then
LastCol = ActiveSheet.UsedRange.Columns.Count +
ActiveSheet.UsedRange.Column - 1
Rows("1:1").Insert shift:=xlDown
Range("A1").Select
ActiveCell.Value = 1
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(1,
LastCol)), Type:=xlFillSeries
Can I do something like LastCol+1 needs to be autofill with a date
timestamp?
Fairly new to this so excuse my ignorance?
Thanks
Steve