I'm having trouble with the syntax when naming a range for pasting the value of a single cell into the same column but down to the last row of data.
So if Activecell.address is $D$2
X = Activecell.column (ie 4)
Y = activecell.row (ie 2)
r = ActiveSheet.UsedRange.Rows.Count (say it's row 5)
I want to copy the active cell and paste it in the same column down to the last used row r.
If it was hardcoded it would be:
Range("D2").Select
Selection.Copy
Range("D25").Select
ActiveSheet.Paste
[highlight] What's wrong here?
Range((x & y) & ":" & (x , r)).Select
ActiveSheet.Paste
[/highlight]
So if Activecell.address is $D$2
X = Activecell.column (ie 4)
Y = activecell.row (ie 2)
r = ActiveSheet.UsedRange.Rows.Count (say it's row 5)
I want to copy the active cell and paste it in the same column down to the last used row r.
If it was hardcoded it would be:
Range("D2").Select
Selection.Copy
Range("D25").Select
ActiveSheet.Paste
[highlight] What's wrong here?
Range((x & y) & ":" & (x , r)).Select
ActiveSheet.Paste
[/highlight]