Hi guys,
I have a table of data, I've added a new column in 1st position (column A), new value in cell A:2.
I want a code to run the value down the column to the end of the length of the table.
Relevant part of code:
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.ColumnWidth = 15.43
Range("A1").Select
ActiveCell.FormulaR1C1 = "Customer Code"
Range("A2").Select
ActiveCell.FormulaR1C1 = "=[CONTRACT.xlsx]Export!R2C1"
Range("A2").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("A2:A288")
Range("A2:A288").Select
As you can see if my reports vary in the number of rows next time, it is still going to paste the value down to A288.
Can anyone advise what I can put in its place sop that no matter what number of rows are produced from a new report it will only paste to the length of the table (sorry if the tech talk isn't correct, I'm just starting)
Thank you
I have a table of data, I've added a new column in 1st position (column A), new value in cell A:2.
I want a code to run the value down the column to the end of the length of the table.
Relevant part of code:
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.ColumnWidth = 15.43
Range("A1").Select
ActiveCell.FormulaR1C1 = "Customer Code"
Range("A2").Select
ActiveCell.FormulaR1C1 = "=[CONTRACT.xlsx]Export!R2C1"
Range("A2").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("A2:A288")
Range("A2:A288").Select
As you can see if my reports vary in the number of rows next time, it is still going to paste the value down to A288.
Can anyone advise what I can put in its place sop that no matter what number of rows are produced from a new report it will only paste to the length of the table (sorry if the tech talk isn't correct, I'm just starting)
Thank you