+ Reply to Thread
Results 1 to 5 of 5

Copy/Paste Rows to Other Sheets, multiple conditions

  1. #1
    Registered User
    Join Date
    10-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Copy/Paste Rows to Other Sheets, multiple conditions

    Hi,

    I have a master set of data which I would like to run a macro against to copy and paste into the appropriate tabs (within same workbook). There are a couple of traits I should note:

    1. Master data should not be deleted
    2. Master data is housed in a template with header formatting thus the starting row for pasting on the sub tabs is row 3.
    3. Not all defined conditions/values to drive the copying will be found every time.
    4. Values driving the copying will be text
    5. There are 4 categories (tabs) which will each have multiple possible values that will fit into them. (from my attached example --> YES tab could have YES condition 1, 2 or 3 etc.
    6. The column range of data will be constant but the number of rows will change.
    7. Entire row should be copied over

    As the list of rules will number around 50, I am happy to break these into a hierarchy and run separate macros (later linked together) to search for all YES conditions, then MAYBE, then NO.

    I am hung up on managing a method for incorporating all the various possible values and how to have the program move on if it doesn't find a value.

    Any help is much appreciated! Please see attached sample spreadsheet.

    Best.
    Attached Files Attached Files
    Last edited by financeguy57; 02-17-2011 at 01:43 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy/Paste Rows to Other Sheets, multiple conditions

    I think this is what you want:
    Please Login or Register  to view this content.
    Let me know.

  3. #3
    Registered User
    Join Date
    10-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy/Paste Rows to Other Sheets, multiple conditions

    Thanks for the help!

    So I'm playing with this a little and think I see how you built the code out.

    If InStr(1, Range("A" & irow).Value, "yes", vbTextCompare) this would be my condition, the condition being the "yes"

    this is followed by the destination if a match is found.

    Does each condition, lets say there were 3 values which would constitute a move to the YES tab, have to be followed by a destination or can all values which have the same end move be linked to a single destination line?

    I see the command to start looking on the master sheet at row 3. What would be a command line to start pasting at row 3?

    If these would be answered by my running the program I'm just taking time to tinker with it before going forward. My skills are less than robust.

    Thanks again for taking the time to read this and for your help.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy/Paste Rows to Other Sheets, multiple conditions

    Does each condition, lets say there were 3 values which would constitute a move to the YES tab, have to be followed by a destination or can all values which have the same end move be linked to a single destination line?
    I am not sure about this question. The code just searches for the text "yes" so if you had yes 3, or yes 10, or 10 yes, or 1yes0, it would identify it.

    I see the command to start looking on the master sheet at row 3. What would be a command line to start pasting at row 3?
    I have it set to paste on the next available row. So if you wanted it to start pasting in row 3 just put a value in row 2.

    I tried it on your test book an it worked except for the summary sheet and the sheet tabs didnt line up perfectly.

  5. #5
    Registered User
    Join Date
    10-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy/Paste Rows to Other Sheets, multiple conditions

    Thank you for your help and input. I have been playing with this and think I can mold it into something that will work very well.

    Best.

+ 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