+ Reply to Thread
Results 1 to 7 of 7

Copy and paste conditional data to new worksheet

  1. #1
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Copy and paste conditional data to new worksheet

    I am new to macros but I know that it will make my life easier if I can get this working properly.

    I have some data ('Master' worksheet) with a specific SKU in column C and for each SKU I have a worksheet. I would like a macro to filter the data and copy/paste all the rows with the given value to the appropriate worksheet (so all the rows with a code value of 1.1 get copied to the 1.1 worksheet). I've attached sample data. Also, I do not want the titles copied, just the data.

    Thank you in advance for any help!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy and paste conditional data to new worksheet

    I should probably add that for my real data, I have 74 SKUs and I have a separate worksheet for each one.

  3. #3
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Copy and paste conditional data to new worksheet

    Hi emq,

    Try with:

    Please Login or Register  to view this content.
    Hope this helps,

    Regards.

  4. #4
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy and paste conditional data to new worksheet

    Thank you. Works on the sample data, will try it shortly on the real stuff (then mark this solved).

  5. #5
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy and paste conditional data to new worksheet

    This isn't working with my actual spreadsheet/data.

    I can't think of what the difference would be between my sample and my actual data.

    I'm getting an error as follows: "subscript out of range"

    and it points to this row when I debug

    m = Worksheets(ShtName).Range("A" & Rows.Count).End(xlUp).Row


    Any ideas?

  6. #6
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy and paste conditional data to new worksheet

    That being said though, while I am getting that error the macro does seem to be executing the correct steps and copying/pasting the data. So I am not sure if that error is a problem or not.

  7. #7
    Registered User
    Join Date
    07-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy and paste conditional data to new worksheet

    I'm still unable to use this on my real data and I can't figure out the difference between it and my sample data.

    Any thoughts?

+ 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