+ Reply to Thread
Results 1 to 4 of 4

Using Range (from Userform) as Variable

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    28

    Using Range (from Userform) as Variable

    Hello,

    I have a userform where I want users to place a letter in one text box to reference a column and a number in another textbox to reference a row. I'm trying to concatenate the values of the two textboxes to create a range which I can define as a variable.

    If I use this code everything works fine:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But I can't seem to create a variable from the same code. Say I just want name a variable to select the cell... this code isn't working:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Any thoughts?
    Last edited by ktennies; 05-17-2013 at 10:15 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Using Range (from Userform) as Variable

    Use "Set":

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Using Range (from Userform) as Variable

    I had actually tried that previously, but I was working with the Dim statement and must not have had it set as a range at that point. I was so close! In any case, it's working now.

    Thanks for your help TMS!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Using Range (from Userform) as Variable

    You're welcome.

+ 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