1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

macro help - linking cell reference to number in another cell

Discussion in 'Business Applications' started by ioan09, Jan 23, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. ioan09

    ioan09 Thread Starter

    Joined:
    Jan 23, 2009
    Messages:
    7
    would like to write a macro involving cell references, which changes when the number in another cell changes

    e.g if cell = 1, uses b2
    if cell = 2, uses b3

    please help
     
  2. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    "Uses" B2 (or B3) ... to do what, exactly?

    Please provide more info.
     
  3. turbodante

    turbodante

    Joined:
    Dec 19, 2008
    Messages:
    744
    Can this not be done by the 'if' formula?
     
  4. ioan09

    ioan09 Thread Starter

    Joined:
    Jan 23, 2009
    Messages:
    7
    what i mean is, i want the cell reference in my macro to change according to the value in another cell, so if the value is 2, the macro will say (3,2) and if the value is 5, (3,5)
     
  5. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    You can use something like:

    Cells(3, Range("A1")).Select

    But an idea of what you're trying to do overall would be useful.
     
  6. ioan09

    ioan09 Thread Starter

    Joined:
    Jan 23, 2009
    Messages:
    7
    what if that cell is in another worksheet
     
  7. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    This formula works if your reference data is in column A in a worksheet called Book3
    =IF([Book3]Sheet1!$A1<>"","(3,"&[Book3]Sheet1!$A1&")")
    Just enter it into your other sheet and drag down the column - the reference cell will change to A2, A3, etc.
    Insert the real name of your other worksheet in place of Book3
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/793662

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice