Currently I have a value in a column that I am extending by a fixed number using relative references.
Selection.AutoFill Destination:=ActiveCell.Range("A1:A34"), Type:=xlFillCopy
This makes the autofill inflexible because the relative reference range ("A1:A34") is fixed. Usually the number of records is the same, so no big deal, but whenever the number of records increases or decreases, the autofill should expand or contract to fit. Right now I have to manually that statement.
When importing my sheet I count the number of records (columns) and keep it in a variable "TimeRowOffset". Is there a way to use this variable in the range? Ideally I could just use the following:
Selection.AutoFill Destination:=ActiveCell.Range("A1:TimeRowOffset"), Type:xlFillCopy
When I run that I get a compile error saying "Expected: named parameter"
Any help would be much appreciated!
~Aaron
Selection.AutoFill Destination:=ActiveCell.Range("A1:A34"), Type:=xlFillCopy
This makes the autofill inflexible because the relative reference range ("A1:A34") is fixed. Usually the number of records is the same, so no big deal, but whenever the number of records increases or decreases, the autofill should expand or contract to fit. Right now I have to manually that statement.
When importing my sheet I count the number of records (columns) and keep it in a variable "TimeRowOffset". Is there a way to use this variable in the range? Ideally I could just use the following:
Selection.AutoFill Destination:=ActiveCell.Range("A1:TimeRowOffset"), Type:xlFillCopy
When I run that I get a compile error saying "Expected: named parameter"
Any help would be much appreciated!
~Aaron