+ Reply to Thread
Results 1 to 7 of 7

Please help with a macro using VLOOKUP

  1. #1
    Registered User
    Join Date
    02-22-2017
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    11

    Please help with a macro using VLOOKUP

    Hey guys,

    I am in serious need of help with a macro for work. So I made this test file with the exact rows I'm dealing with on sheets 2 and 4 of a different file. What I need to do is use the A columns on the sheet as a key with Vlookup (actually it doesnt have to be VLookup) and then compare the sheet 2 F column and sheet 4 I column and then make the cells that have the same value in A but different values in F/I to appear yellow in sheet 4's I. If that wasnt a good explanation please let me know and I can elaborate.

    I would really appreciate help on this. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Please help with a macro using VLOOKUP

    The easiest way to do this is using Conditional Formatting, using this formula:

    =I1<>VLOOKUP(A1,Sheet2!$A$1:$F$20,6,FALSE)

    See sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    02-22-2017
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    11

    Re: Please help with a macro using VLOOKUP

    Hi Glen,

    Thanks this seems to work, but I have a couple questions. I need it to select all of the cells in the column as apposed to just until "I20" because the orginal file has around 7k cells. Even though it might bot be effective I kind of want it in VBA because I am adding on to a macro that is going to be used again later for big files. Do you think I could just do this with the macro recorder on and then use the macro it makes for me? Thanks and sorry for being new haha.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Please help with a macro using VLOOKUP

    You could just adjust the ranges to cover what you need, plus a bit more to make it "future-proof". CF is pretty quick. Keep the thread open if you want a VBA solution (i'm hopeless with it!!). Bump it if there's no reply within a "reasonable" period.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,497

    Re: Please help with a macro using VLOOKUP

    Let's start with this.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 03-05-2017 at 11:47 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Registered User
    Join Date
    02-22-2017
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    11

    Re: Please help with a macro using VLOOKUP

    Works like a charm bakerman. Thank you!

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,497

    Re: Please help with a macro using VLOOKUP

    You're welcome and thanks for rep+.
    If this takes care of your question please mark the thread as Solved.
    Last edited by bakerman2; 03-06-2017 at 06:28 AM.

+ 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. Replies: 3
    Last Post: 07-10-2014, 10:56 AM
  2. [SOLVED] Macro- adding Vlookup to a macro
    By TERRI LEE in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 05-06-2013, 02:28 AM
  3. [SOLVED] Adapt A Sumif Macro to A Vlookup Macro
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2012, 06:22 PM
  4. Complex Vlookup/ VBA function or Macro Needed For "if contains text then vlookup"
    By alfykunable in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2012, 03:48 AM
  5. Applying Vlookup using a Macro(Vlookup+Macro) in Excel 2007
    By Sumku in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2009, 08:58 PM
  6. Vlookup in Macro
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2007, 07:04 AM
  7. Replies: 1
    Last Post: 02-26-2005, 02:06 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