I am new to the group and it looks like there are a LOT of knowledgeable folks out there.
I'm hoping I can get some help.
I am looking to create a macro for Excel that will allow the user to select an existing CSV file, then will add 2 columns to the END of the existing columns and create a header at the top, but populate the columns with text (the same text for each column). But it should ONLY populate that column with this test ONLY to the end of the longest column that already exists. (So if the file has 450 records, it should only add the column and the text up to 450 rows)
I have started trying things, but feel that I may be out of my league.
It needs to keep the resulting file as a CSV.
Here is what I have so far, but it is not close....this will add a column, but only if the file has been opened and a cell selected. And it will add the MAX # of rows (65536 in my test).
Any help is appreciated.
Sub Add_Column()
Dim Range1 As Object
Set Range1 = Selection
Selection.EntireColumn.Select
Selection.Insert
Selection.FormulaR1C1 = "Test1"
Range1.Select
End Sub
I'm hoping I can get some help.
I am looking to create a macro for Excel that will allow the user to select an existing CSV file, then will add 2 columns to the END of the existing columns and create a header at the top, but populate the columns with text (the same text for each column). But it should ONLY populate that column with this test ONLY to the end of the longest column that already exists. (So if the file has 450 records, it should only add the column and the text up to 450 rows)
I have started trying things, but feel that I may be out of my league.
It needs to keep the resulting file as a CSV.
Here is what I have so far, but it is not close....this will add a column, but only if the file has been opened and a cell selected. And it will add the MAX # of rows (65536 in my test).
Any help is appreciated.
Sub Add_Column()
Dim Range1 As Object
Set Range1 = Selection
Selection.EntireColumn.Select
Selection.Insert
Selection.FormulaR1C1 = "Test1"
Range1.Select
End Sub