I have an Excel spreadsheet that runs a macro on open. I am attempting to open a csv file, add a column, fill that column in to the end of the other columns with the letter “A”, then save the file back as a CSV. Everything is working properly, except I don’t know how to tell it to fill the “A”‘s down to the end of the other rows. Any suggestions? Here’s what I’ve got so far:
[indent]
Private Sub Workbook_Open()
Dim objXLBook As Excel.Workbook
Set objXLBook = Workbooks.Open(“H:equitracrightfaxcodechg.csv”)
With Columns(“A:A”).Select
Selection.Insert Shift:=xlToRight
Range(“A1”).Select
ActiveCell.FormulaR1C1 = “a”
Range(“A1”).Select
Selection.Copy
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Paste
ActiveWorkbook.Save
End With
End Sub
[/indent]Thanks,
Becky