+ Reply to Thread
Results 1 to 3 of 3

Assign a range through a string cell value

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Question Assign a range through a string cell value

    Hi! Im having trouble with spme VBA coding:
    The idea is to create a code that allows me to assign a cell range through the values inside another cell.
    ie:

    I have written inside the cell B3 this string: "F45". Then, I start my macro, which should read the value inside B3 cell, and make F45 the activecell...

    I tried making this with this code, but doesnt works:

    sub test()
    Dim strcell As String

    strcell = Sheets(1).Range("B3").Value

    Sheets(1).Range("strcell").Activate

    Is it possible to make something like that? I know that in this situation it would be easier to just write Sheets(1).Range("F45").Activate , but the desired cell needs to be stored somewhere (thought the easier way was to store it inside a cell) and is not a constant, forcing me to do something like this. Any help is truly appreciated
    Thanks a lot.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    19,926

    Re: Assign a range through a string cell value

    Just remove double quotes
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-01-2013
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign a range through a string cell value

    Wow, can't believe it's so easy! saved my life! Thanks!

+ 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