+ Reply to Thread
Results 1 to 4 of 4

Macro help: vlookup

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro help: vlookup

    Hi there,

    Hope you can help. I want to create a macro that will be activated via a button on a sheet ("Display tool"), but will be executed on another sheet ("Data").

    I want to copy data present on B3 to CJ3 and have it overwrite the appropriate row in a pre-populated table that exists between B7:CJ1500. The row will be determined based on a lookup of the text in B3 in B7:B1500.

    Some things to note:
    1. The macro should run in the background once the button is clicked - i.e. sheet should not change from "Display tool" (where the macro button exists) to "Data" (where the macro will be executed).
    2. Data should be pasted as values

    I have no knowledge of macros to speak of, but this is what I was able to put together using the record macro function and the some google searches. Appreciate any input you can provide!!

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Macro help: vlookup

    Well the first thing you are missing would be to turn your screen updating back on. Always turn things back on if your turning them off at the beginning of your code. This is very crucial when writing macros.

    on a seperate note try this code. I am not exactly sure what you are wanting but we can go from here. I am not sure which worksheet your lookup needs to be in though. Also are you wanting a lookup?? if you did a look up your look up will always give you 1 because you are looking up a column not a row? This is what you are illustrating from your question, but i don't think it will be what you want:

    Please Login or Register  to view this content.
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Macro help: vlookup

    My computer posted my solution twice, I apologize

  4. #4
    Registered User
    Join Date
    09-24-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro help: vlookup

    Hi Amotto11,

    Thanks for your help. I actually got a "400" error when I tried to run the code.

    The lookup was intended to find the appropriate row (in the table that spans B7:CJ1500) in which the data that exists in B3:CJ3 should be pasted. I apologize if the nomenclature wasn't clear.

    A colleague actually helped me out with my problem. For anyone who is interested, please see below:

    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. [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
  2. [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
  3. 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
  4. 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
  5. Replies: 1
    Last Post: 02-26-2005, 02:06 PM

Tags for this Thread

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