+ Reply to Thread
Results 1 to 4 of 4

vlookup using absolute cell references in VBA

  1. #1
    Registered User
    Join Date
    06-10-2004
    MS-Off Ver
    Office 2003
    Posts
    70

    vlookup using absolute cell references in VBA

    Hi all.

    Good news, Google answers most of my questions. Bad news, not this one.

    I'm trying to use vlookup in vba to look at a specific source cell.

    If the month is Jan, the vlookup formula goes into column L, for Feburary it goes into column T, March goes into AB - but I always want the source column to be A.

    I tried this, but it didn't work...

    ActiveCell.FormulaR1C1 = "=VLOOKUP($A1,M1:Z53,2,FALSE)"

    Anyone know what I need to do?

    Thanks

    Colin

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Colin Vicary
    Hi all.

    Good news, Google answers most of my questions. Bad news, not this one.

    I'm trying to use vlookup in vba to look at a specific source cell.

    If the month is Jan, the vlookup formula goes into column L, for Feburary it goes into column T, March goes into AB - but I always want the source column to be A.

    I tried this, but it didn't work...

    ActiveCell.FormulaR1C1 = "=VLOOKUP($A1,M1:Z53,2,FALSE)"

    Anyone know what I need to do?

    Thanks

    Colin
    Hi,

    try

    ActiveCell.Formula = "=VLOOKUP($A1,M1:Z53,2,FALSE)"

    (it's not R1C1)

    what were you really trying to lookup, why a table M to Z if you want column 2 ?


    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    06-10-2004
    MS-Off Ver
    Office 2003
    Posts
    70
    Genius!!

    Worked perfectly, thanks.

    I don't know why I'd do without you guys.

    Colin

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Colin Vicary
    Genius!!

    Worked perfectly, thanks.

    I don't know why I'd do without you guys.

    Colin
    good to see that it worked for you, and thanks for your response.

    ---

+ 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