+ Reply to Thread
Results 1 to 4 of 4

Conditional Copy

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Charlottetown
    MS-Off Ver
    Excel 2007
    Posts
    10

    Conditional Copy

    I've been working on a particular spreadsheet and, being new to VBA, I have a problem that I cannot solve on my own. I've searched through the forums without much success.

    I have a button that creates a new sheet for every unique entry in Column A (the unique list itself is created on another sheet Indications) from Sheet Master. What I would like to do is copy the first two rows (headers) of Sheet Master, along with each row containing the entry (there may be 2-5 instances of each entry) to the new sheets. The code I have now is below, which creates the sheets but does not copy anything:

    Please Login or Register  to view this content.
    Last edited by dfleming; 09-09-2010 at 11:07 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Conditional Copy With a Twist

    It looks like you are trying to copy the used range from the new sheet
    You may have to Specify the Sheet, for example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-02-2010
    Location
    Charlottetown
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Conditional Copy With a Twist

    That's good, however it's copying all data from the original Master Sheet. I need it to simply copy the rows which contain the particular entry. So, For every Apple in Column A, on sheet "Apple" it copies the Apple rows.

  4. #4
    Registered User
    Join Date
    09-02-2010
    Location
    Charlottetown
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Conditional Copy With a Twist

    I have solved this and, for archival purposes, will post my solution.

    After davesexcel's copy of all information to the sheets, I added the following filter:

    Please Login or Register  to view this content.
    To filter for just the results that match the sheet name.

    Thanks for the help. This forum is excellent!

+ 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