Forum Discussion

Logaraj Sekar's avatar
Logaraj Sekar
Iron Contributor
Apr 18, 2018
Solved

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"...
  • Haytham Amairah's avatar
    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 Sub

     

    I hope this helps you

    Haytham 

Resources