+ Reply to Thread
Results 1 to 7 of 7

Attempt Copy and Paste

  1. #1
    Registered User
    Join Date
    11-19-2009
    Location
    Philadelphia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Attempt Copy and Paste

    I am attempting to create a workbook where new worksheets will be created and named based on the values in a set column range. Then copy and paste all the data in the rows containing that value to the newly created and named worksheet. Ex. Account # 12345 data pasted to the worksheet labeled 12345. Any assistance would be greatly appreciated.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy and Past Macro assistance needed

    This is a commonplace need. If you post up a sample workbook accurately depicting sample data, the sample "values in a set column range"... then I can adjust one of my macros for your layout.

    Click GO ADVANCED and use the paperclip icon to post up your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-19-2009
    Location
    Philadelphia
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: Attempt Copy and Paste

    Attached is a mock up. So Account 12345 and all the corresponding data through column 23 would need to be copied into its own worksheet labeled 12345.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: Attempt Copy and Paste

    Where is this column of values you indicated? Do you need the macro to ascertain the values by itself from column E?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: Attempt Copy and Paste

    This will create the sheets and parse the accounts to the account in order. So the macro will organize the sheets, too.

    If you run it a second time, it doesn't ADD to the existing sheets, it replaces them.
    Please Login or Register  to view this content.
    This macro belongs in a regular module, not a sheet module or ThisWorkbook module.

  6. #6
    Registered User
    Join Date
    11-19-2009
    Location
    Philadelphia
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: Attempt Copy and Paste

    I apologize, I should have been more specific. The list of account numbers would come from one worksheet, and the data from another. Ex. There is a sample of accounts taken (12341, 12344, 12348 etc.) The sample would be housed on the sample worksheet. The worksheets to be created and named would come from the sample worksheet. Once the new worksheets have been created and named, data from the data worksheet would be copied and pasted to its own worksheet (Account 12341 worksheet would have only 12341 data etc).

    Also, the sample column would be "D" instead of "E". Thanks again for your help.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: Attempt Copy and Paste

    Here is my original macro updated to make it more "editable". It is friendlier to use than the one posted above. So use this instead as a basis.

    Please Login or Register  to view this content.

    ===========
    Sorry I missed your message above. Here is a tweaked version that allows you to use a second sheet. Put the names to use in the second sheet from A2 downward, and call that sheet "Names".
    Please Login or Register  to view this content.

    Does this work for you?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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