+ Reply to Thread
Results 1 to 3 of 3

Question: If found, then copy row to next sheet.

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Question: If found, then copy row to next sheet.

    Hi,

    I have a sheet that I renamed wsStart and another sheet wsEnd.

    In the wsStart, there are listing of member number, name and address (data in rows)

    I want to do a macro that in wsEnd:
    1) It will check starting, if wsEnd (cell A2) is found in wsStart (Column A), then copy the rows from wsStart to itself.
    2) It will then continu to the next A3 in wsEnd, until last used rows in column A.

    I know that we can do as Vlookup, but I want it to be preform with a macro instead of formula.

    Thanks.

  2. #2
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Question: If found, then copy row to next sheet.

    It's not pretty, but it works for me. Too much hard coding, of course, but if you're only looking for a couple of values to move back and forth, try this:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Question: If found, then copy row to next sheet.

    Can't we do something such as define the column A in wsStart in a variable from A2 to last rows.
    Then do a loop? Like,
    X = 2 to wsStart.rows.count 'from A2 to last row in wsStart
    Y = 2 to wsEnd.rows.count "from A2 to last row in wsEnd

    Then make a search:
    If value in A2 of wsEnd = one of the value in column A2 to last row of wsStart, then copy that row and paste it into A2 of wsEnd.
    Then next range...

    Thanks.

+ 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] Copy row from one sheet and paste to another if a key word is found in 1 column of sheet 1
    By killdozer in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-17-2014, 02:27 PM
  2. [SOLVED] Help with VBA: Copy not found value to another sheet
    By caracolesa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2013, 03:32 AM
  3. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  4. Replies: 16
    Last Post: 01-20-2013, 09:40 AM
  5. Copy Row from Sheet 1 to Sheet 2 when a certain string is found in a cell
    By vizion9999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2012, 12:01 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