+ Reply to Thread
Results 1 to 2 of 2

Using variables for range select

Hybrid View

  1. #1
    Registered User
    Join Date
    07-28-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    1

    Using variables for range select

    I've created a userform and have several user defined inputs I want to be placed in a user defined column. I have the user enter a letter (and would need them to be able to go past z i.e. AA and beyond). I would like to use the range("letter#").select function but do not know how to use it with a user defined letter. I've tried textbox1.value = X and then range("X1").select and several variations but it wont work. Please help.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using variables for range select

    Hello powers023,

    Welcome to the Forum!

    I am not clear on what you want to do here. If you want to define a range in A1 notation then the variable should be a string type. The example below selects the cell "AA25" on the ActiveSheet. As long as the string is a valid range, the code won't error.
      Dim Addx As String
    
        Addx = "AA25"
        Range(Addx).Select
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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