+ Reply to Thread
Results 1 to 4 of 4

Vlookup Macro for copy paste of rows

  1. #1
    Registered User
    Join Date
    03-13-2009
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    98

    Vlookup Macro for copy paste of rows

    I require a macro, which will copy rows (highlighted in green) in worksheet named LIVE VWAP (Rows 35 and 36), and paste into worksheet named Master Data. This should be done by looking up the date in worksheet LIVE VWAP (Cell A35) and pasting it into the rows of the same date (highlighted in red in row 42 in this example). Worksheet Master Data(2) shows the end results (highlighted in yellow in rows 42&43)

    I have tried using Vlookups but cant seem to make it work.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Vlookup Macro for copy paste of rows

    sorry it is not clear what are going to "look up". you want the rows in rows 35 and 36 in thes sheet "live VWAP" is to be copied in the sheet Master data in THE FIRSTS AVAILABLE ROW.

    If this is what you want

    Please Login or Register  to view this content.
    But this is only copying two rows from one sheet to another sheet. This is not repeated operation. Then why do you need a macro . why not manually copy?

  3. #3
    Registered User
    Join Date
    03-13-2009
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Vlookup Macro for copy paste of rows

    The look up is required to match the dates.
    In worksheet named 'LIVE VWAP' the two rows (36&36) start with the date 10/02/2010.
    These two rows now have to be pasted into the row with the exact date i.e 10/02/2010 in worksheet named 'Master Data' (which is in row 42). Thus the results you see are in worksheet named 'Master Data(2)' rows 42 and 43.

    I could do this manually but I am trying to fit this in along with other function in the macro. Thanks

  4. #4
    Registered User
    Join Date
    03-13-2009
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Vlookup Macro for copy paste of rows

    The code works fine now. I changed the offset value to zero i.e.

    .offset(1,0).PasteSpecial

    was changed to

    .offset(0,0).PasteSpecial

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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