+ Reply to Thread
Results 1 to 3 of 3

Using Variables in Ranges to select entire rows or columns

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    45

    Using Variables in Ranges to select entire rows or columns

    I know it's possible to set these 2 ranges to capture an entire row or column:

    Range ("1:1")
    Range ("C:C")

    How would I do the same using variables if x = 1 and y = C? Please include the declarations as I am having trouble understanding if I can use string for y.

    Bonus points, how do I select Range ("A1:A2") entirely with variables?

    Thank you!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Using Variables in Ranges to select entire rows or columns

    Hi

    here goes.

    Please Login or Register  to view this content.
    Note that this is only one way. Depending on how big you want the range(a1:a2) to be, you could use resize with variables to set the expanded way.

    rylo

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Using Variables in Ranges to select entire rows or columns

    Odd, I tried something like this but it kept throwing up on ":". I had y as string as well. I must have made a mistake somewhere, thanks for the response

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1