+ Reply to Thread
Results 1 to 15 of 15

Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

  1. #1
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Talking Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Currently working on a workbook that has 1 Main Page of data entry that will copy information to other worksheets accordingly, based of criteria in column H. For Example, any scrap on Main Page Worksheet will be copied into the Scrap worksheet. However, I need all the same table headings on Row 1, on all pages.

    Any help would be greatly appreciated. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Try:
    Please Login or Register  to view this content.
    You may have to change the destination sheet names for "Repair" and "Rework". You didn't specify the sheets you wanted copy to if those choices were made in the drop down.
    Last edited by Mumps1; 10-25-2013 at 05:38 PM.

  3. #3
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    This deletes everything. It does not copy. Thanks though.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    When I tried the macro on your file it looked like it worked for me. Try the attached file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Oh. The code is working, however, is there a way to copy the contents, and not change the formatting in the other worksheets? For example I enter a new entry, run the macro, and it paste the new data in the according worksheet, but leave the existing information alone, that is already in there?

    The different worksheets will have other formatting, so I don't want to mess up that in the other worksheets once the macro is ran.

    This is great so far. I really appreciate your help.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    See if this works for you.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Well I appreciate it. It still is erasing formatting on other worksheets. You have given me somewhere to start. Thanks again.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    I don't understand why that is happening because in my last post the code is set to paste only the values. If you're willing to post a copy of your file. I'll be happy to have a look.

  9. #9
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    It may be operator error. Lol. Here is the worksheet with a little bit more information, and how I would like them formatted.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    The problem was due to the fact that you are working with tables. I have made some changes and additions. Please try the attached file and let me know how it works out.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Oh that looks GREAT!!!Thank you so much MUMPS1. I will begin using and see if there are any bugs. I really appreciate your help. Awesome.

  12. #12
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Ummm. Trying to say this was solved but the option is not available when I click Go Advance...

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    It was my pleasure.

    To mark the thread "Solved":
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

  14. #14
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Mumps1: Is there a way to keep it from putting duplicates in the spreadsheets when the macro is ran? For example, I input data, then run the macro, I only want to copy the most recent/new data, not everything? When this macro is ran, every time, it will put duplicates in the other worksheets.

  15. #15
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Macro to Copy Selected Range from one Worksheet to Another, based off of Criteria

    Try:
    Please Login or Register  to view this content.

+ 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 a selected range based on cell criteria
    By Ronny66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:48 AM
  2. Copy/Paste range of cells to another worksheet based on matching criteria
    By maa50904 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2013, 12:07 AM
  3. [SOLVED] How to set range within a macro based on what range is selected on the worksheet
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2013, 12:49 PM
  4. Macro to copy a range of dates based on matching criteria
    By christopherb in forum Excel General
    Replies: 0
    Last Post: 06-10-2011, 05:39 AM
  5. Macro to copy worksheet data to another worksheet based on criteria
    By excelvb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2011, 04:11 AM

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