Consulting

Results 1 to 4 of 4

Thread: Variable Help

  1. #1
    VBAX Regular
    Joined
    Jul 2005
    Posts
    9
    Location

    Variable Help

    Note this Macro text
    ---------------------
    RegOneTotalRow = Range("84:84").Row
    RegTwoTotalRow = Range("197:197").Row
    RegThreeTotalRow = Range("245:245").Row
    RegFourTotalRow = Range("363:363").Row
    RegFiveTotalRow = Range("445:445").Row
    RegSixTotalRow = Range("459:459").Row
    RegSevenTotalRow = Range("515:515").Row
    RegEightTotalRow = Range("573:573").Row
    RegNineTotalRow = Range("659:659").Row
    RegTenTotalRow = Range("702:702").Row

    ---------------------------
    Is there a way I can have the Ranges (i.e. "84:84") point to a value in an actual cell in a worksheet... so that if I change the number in that cell, the Row Ranges on this Macro adjusts?

    Thanks for your help!

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    RegOneTotalRow = Range(" & Range("A1").Value & ":" & Range("A1").Value &").Row
    And since you only want the row, this should suffice.

    RegOneTotalRow = Range("A1").Value

  3. #3
    VBAX Regular
    Joined
    Jul 2005
    Posts
    9
    Location
    Worked great... Thanks for you help!

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •