+ Reply to Thread
Results 1 to 3 of 3

macro for vlookup (almost completed)

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    macro for vlookup (almost completed)

    Greetings,

    I have three excel workbooks. I am trying to write a vba code in the TEMPLATE workbook, which is almost finished. A "user form" has already been created to select open workbooks in the TEMPLATE.

    I would like the user form in the TEMPLATE to run vlookup in the current month's report based on the categories from previous month's report when the "run vlookup" button is pressed in the TEMPLATE. The vba code is there, but I think these two lines need to be altered -

    Workbooks("March2013-7.xlsx").Activate
    .Formula = "=VLOOKUP(A" & ActiveCell.Offset(1).Row & ",'[February2013-1.xlsx]Sheet1'!$A$4:$B$200,2,FALSE)"

    Right now, these two codes are set for specific reports (March2013-7.xlsx and February2013-7.xlsx) but they need to be set for whatever report is selected in the "userform" table. It won't always be march and february as there are other months of the year

    Can someone please help me out with this? Thank you so much!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: macro for vlookup (almost completed)

    Does anyone know? Please help

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

    Re: macro for vlookup (almost completed)

    Duplicate post

    http://www.excelforum.com/excel-prog...h-vlookup.html

+ 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. Running one macro after another has completed
    By martinpgibson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2013, 08:29 PM
  2. Problem Running Macro for Completed Code
    By vargs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-11-2010, 01:46 PM
  3. Macro for completed files
    By Nunzio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:27 AM
  4. Closing Workbook After Macro Completed
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2008, 12:19 PM
  5. Has anyone ever encountered an error AFTER the macro has completed
    By eluehmann in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2006, 11:20 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