+ Reply to Thread
Results 1 to 6 of 6

Autofill Vlookup Macro to Last Row of Data

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Autofill Vlookup Macro to Last Row of Data

    Hi Everyone,

    I apologize if this question has already been answered. I have been trying to figure this out forever and I cannot get it to work. I have a macro in which I recorded a vlookup that I insert into column G that pulls from column F to give me an account name from another file.

    I have about 30 different files that I use this macro on, and they all have a different number of rows. Is there a way to get the macro to autofill down to the last row of data in column F? For example the first file I run the macro on might have 188 rows, but the next file only has 30. Here is a copy of what I have so far:

    Please Login or Register  to view this content.
    Any help is greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Autofill Vlookup Macro to Last Row of Data

    Please Login or Register  to view this content.
    Select a longer range e.g.

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Autofill Vlookup Macro to Last Row of Data

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Autofill Vlookup Macro to Last Row of Data

    You can select the last cell and save its row number as a variable

    Then build that row number into your formula fill.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-01-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Autofill Vlookup Macro to Last Row of Data

    Quote Originally Posted by oeldere View Post
    Please Login or Register  to view this content.
    Select a longer range e.g.

    Please Login or Register  to view this content.
    If I select a longer range I will get N/A's all the way from the last line of data to 1000

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Autofill Vlookup Macro to Last Row of Data

    Then you have to change your VLookup formula. See the red text.

    Partnering'!$C$3:$C$10,8,0)"

    Although you better use the other suggestions. Those solutions are much better than my version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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