+ Reply to Thread
Results 1 to 5 of 5

variable to store multiple values

  1. #1
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    variable to store multiple values

    Hi Guys

    I need a bit of help with the below macro which I am trying to create

    I recorded the below vlookup, which works perfectly. It checks a list on sheet “Map” and returns a value depending on whether the reference is one of the 6 or not. These 6 are likely to change over time so I would prefer to declare them as variables rather than build them directly into the macro

    Please Login or Register  to view this content.
    Was thinking of declaring the variables which will always be in C2-C7 as below and substituting each reference in the vlookup. However something is wrong as I am getting a value of 1 for all
    Please Login or Register  to view this content.
    Can anyone suggest what might be wrong and how I might fix this please?

    P.S. "Curr" is probably not the right one to use but am not sure which is

    Thanks All

    Noel
    Last edited by somesoldiers; 08-20-2009 at 08:47 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: variable to store multiple values

    Not sure but have you just got a bit quote-happy...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: variable to store multiple values

    Hi Stephen,

    Am getting Run Time Error 1004

    Application-defined or object defined error

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: variable to store multiple values

    You could use MATCH:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: variable to store multiple values

    that's way tidier than what I had and works a treat,

    thanks a million guys

+ 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