+ Reply to Thread
Results 1 to 5 of 5

MACRO lookup help

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Lightbulb MACRO lookup help

    Hi Guys,

    I am having trouble with my macro. I have attached my excel sheet for your reference.

    Basically, I want a Macro that Looks up columns B & C of current sheet and matches it with table in the charges tab, and then returns hourly pay in column D.

    I have created the macro but it's giving me Run time 1004 error.
    Also, my formula is incorrect. Maybe that's why my macro isn't working?

    Kindly, help me out with the formula//macro! Thank youuu
    Attached Files Attached Files
    Last edited by nawGo; 03-07-2014 at 05:19 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: MACRO lookup help

    Hi,

    Why use a macro when a compound formula will do.

    e.g. In D2 copied down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you need a macro then just have the macro create the same formula in the range.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: MACRO lookup help

    Hi Richard,

    Your formula works great,thanks!

    However, I need the macro. I basically just replaced the old formula with yours, when I run it, it gives me a syntax error. Kindly, let me know what I am doing wrong.

    Thanks for your help

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: MACRO lookup help

    Hi,

    There were a couple of problems. Missing closing parentheses ) and the oft forgotten need to include double quote literals around text that is itself a literal. e.g. where Excel has "IN", the VBA equivalent is ""IN""

    Use the following.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: MACRO lookup help

    Thanks Richard!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro for lookup
    By WillemB in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-24-2014, 11:26 AM
  2. V Lookup and Macro.
    By RMGraham in forum Excel General
    Replies: 0
    Last Post: 08-21-2012, 03:30 PM
  3. lookup macro help
    By mm5384 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2012, 10:29 AM
  4. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  5. lookup macro
    By tkollo1984 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2011, 02:48 PM

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