none
Use a variable to define the row number in a Range ("???").select RRS feed

  • Question

  • Dim r as integer

    r=5

    Range("G r").select

    This stalls with 'Range' _Global fail

    I want to manipulate r (the row that logic produces) and use to select a cell

    Help...fix

    Friday, April 24, 2015 12:30 AM

All replies

  • Re:  specify a range
    '---
    Dim r As Long
    r = 5

    Cells(r, "G").Select

    -or-

    Range("G" & r).Select

    '---

    Jim Cone
    Portland, Oregon USA
    https://goo.gl/IUQUN2 (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Proposed as answer by ryguy72 Tuesday, May 5, 2015 7:10 PM
    • Edited by James Cone Sunday, October 30, 2016 8:25 PM
    Friday, April 24, 2015 1:27 AM