RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 790
- Office Version
- 365
- Platform
- Windows
I have a sheet where I want to copy the contents of a column titled "Tourref" to another sheet.
Tourref can appear in U, or maybe W, or T, etc.
What I've got is a loop that goes horizontally until it finds the Tourref column, but in the VBA It was like this:
And I need to do something more like this:
Does that make sense? I just need to tell it, wherever it is, get that column from 2 until the very end, whether it's U or T or V or whatever. Thanks!
EDIT: I have this, but it's selecting the entire range from row 2 downwards
I just need it to select row 2 downwards in column U only (c=activecell.column correctly identifies column U as column 21)
Tourref can appear in U, or maybe W, or T, etc.
What I've got is a loop that goes horizontally until it finds the Tourref column, but in the VBA It was like this:
Code:
Range("U2:U" & Lastrowml).Copy Destination:=ct.Range("A3")
And I need to do something more like this:
Code:
Range(activecell.column & 2 : activecell.column & Lastrowml).Copy Destination:=ct.Range("A3")
Does that make sense? I just need to tell it, wherever it is, get that column from 2 until the very end, whether it's U or T or V or whatever. Thanks!
EDIT: I have this, but it's selecting the entire range from row 2 downwards
Code:
c = ActiveCell.Column
Range(c & "2:" & c & Lastrowml).Copy 'Destination:=ct.Range("A3")
I just need it to select row 2 downwards in column U only (c=activecell.column correctly identifies column U as column 21)
Last edited: