+ Reply to Thread
Results 1 to 13 of 13

Macro for VLookup of number to assign name

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2000
    Posts
    23

    Macro for VLookup of number to assign name

    Hi guys,

    I have 2 sheets on this workbook, Final Results and Count.

    I need to lookup the FLOC number in Final Results! Column A, Check it against the FLOC numbers in Count! Column A, and assign Count! Column C to the match.

    I know how to do this with a VLookup manual, but when I try to automate it, it never works.

    Little help?
    Attached Files Attached Files

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    so this was me just turning on the macro recorder to see how to program what I want....this is a great technique to learn stuff, BUT, it doesn't make it very dynamic....so you'll have to figure last rows so if you change the size of the data set code will work...

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for VLookup of number to assign name

    Formula in B2 and drag it down.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    @AB33 - I believe he is using Excel 2000 and I don't think IFERROR was available then....I did the same though and had to remove it....

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for VLookup of number to assign name

    Judgeh59,
    Thank you!
    Yes, only available in 2007 and beyond, but there is an equivalent function called ISNA

  6. #6
    Registered User
    Join Date
    07-30-2013
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2000
    Posts
    23

    Re: Macro for VLookup of number to assign name

    I need it to be fully automated as the sheet itself is generated as part of a macro.

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2000
    Posts
    23

    Re: Macro for VLookup of number to assign name

    judgeh59, i'm trying your one out now, wish me luck!

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    AB33 - also a ISERROR back in 2000 if my memory is correct....

  9. #9
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    @andrew - good luck

  10. #10
    Registered User
    Join Date
    07-30-2013
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2000
    Posts
    23

    Re: Macro for VLookup of number to assign name

    judgeh, having a few problems! The paste at the end is the problem, i'm trying to make it general, i.e. able to assign for any data input not the specific one listed; you've given me a great start, any ideas for next step?

  11. #11
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    well all the copy/special paste is doing is removing the formula....you can delete the last 3 lines of code and the formula will stay intact...I'm not sure what you are trying to say in the I.E. section....sorry

  12. #12
    Registered User
    Join Date
    07-30-2013
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2000
    Posts
    23

    Re: Macro for VLookup of number to assign name

    Right, all i need is for the macro to paste into Column J instead of Column B, any ideas?

    FYI, I suck at VBA, I may be asking silly questions, it's a distinct possiblity that I am now!

  13. #13
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro for VLookup of number to assign name

    not a problem - we probably all sucked at VBA at some point in time --- try this

    Please Login or Register  to view this content.

+ 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. Macro to count consecutive blank cells and assign a number
    By voitoosh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-08-2013, 03:24 AM
  2. Assign a macro to a numpad number
    By Cutiesusiederkins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 09:21 PM
  3. Creating macro to assign the next number in a series from a separate worksheet
    By ladydubs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2011, 11:59 AM
  4. Replies: 7
    Last Post: 12-18-2008, 07:34 PM
  5. Assign one number to a number range
    By Sue in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-05-2005, 09:05 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