Select cells using RC:RC format where the column is defined and rows are hard coded

  • Previously, I was able to use the Range statement where my latter row number is defined by RptNextStartRow as follows:
    This VBA code selects cells a13:m500
    Private Sub PasteFromRaw_Click()
    Dim RptNextStartRow As Integer
    RptNextStartRow = ActiveSheet.Cells(3, 2).Value (For this example the value is 500)
    Worksheets("Raw Data").Activate
    Worksheets("Raw Data").Range("a13:m" & RptNextStartRow).Select
    End Sub


    Following the above logic, I was expecting this VBA code to select cells V7:V127
    However, it selects all columns in the worksheet for rows 7 through 127
    Private Sub FormulasToNewWeek_Click()
    Dim RptNextStartCol As String
    RptNextStartCol = ActiveSheet.Cells(1, 2).Value (For this example the value is V)
    Worksheets("INPUT COMBINED").Activate
    Worksheets("INPUT COMBINED").Range(RptNextStartCol & "7:" & RptNextStartCol & "127").Select
    End Sub


    Can this code be revised or is there another way to accomplish selecting the row that is defined by RptNextStartCol?
    Thank you

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!