Forum Discussion
Logaraj Sekar
Apr 18, 2018Iron Contributor
How to Select Range using VBA?
Hello everyone, I have values in "Column AD" & "Column AF" from First row. Row count changes everyday in both column. I'm doing manual selection for both column (eg. Range("AD2:AD53,AF2:AF46"...
- Apr 18, 2018
Hi Logaraj,
Please try this macro:
Sub SpecificSelection()
Dim ColAD As String
ColAD = "AD1:" & "AD" & Range("AD1048567").End(xlUp).Row
Dim ColAF As String
ColAF = "AF1:" & "AF" & Range("AF1048567").End(xlUp).Row
Dim ColsAD_AF As String
ColsAD_AF = ColAD & "," & ColAF
Range(ColsAD_AF).Select
End SubI hope this helps you
Haytham
Haytham Amairah
Apr 18, 2018Silver Contributor
Hi Logaraj,
Please try this macro:
Sub SpecificSelection()
Dim ColAD As String
ColAD = "AD1:" & "AD" & Range("AD1048567").End(xlUp).Row
Dim ColAF As String
ColAF = "AF1:" & "AF" & Range("AF1048567").End(xlUp).Row
Dim ColsAD_AF As String
ColsAD_AF = ColAD & "," & ColAF
Range(ColsAD_AF).Select
End Sub
I hope this helps you
Haytham