+ Reply to Thread
Results 1 to 15 of 15

Split worksheet

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Split worksheet

    Good Day

    I am new and asking assistance with a macro that would copy workbook content into
    diferent worksheets on the same workbook. The column that is to be used to filter is column
    F11 which is the salesrep column.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Split worksheet

    Hi Luphai

    You have not specified about the data to be copied. Please explain what you wish to copy to different worksheets in the same workbook.
    Click *, if my suggestion helps you. Have a good day!!

  4. #4
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    I would like to copy contents the Salesrep column with corespending rows to new worksheet

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Have you tried my code?

  6. #6
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    AB33

    Just did but I see its adding two blank sheets as well either than
    that its working fine.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Luphai,
    The two existing sheets have already been there, they are not created by the code. If you want to test it,delete these two sheets, or all sheets for that matter (except sheets 1) and re-run the code and you will see not blank sheets.

  8. #8
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    Thanks AB33 code working like a bomb

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Luphai,
    You are welcome!
    Could you please now close this thread as solved. Go to the top-right-hand of this page-choose "Thread Tools" select solved from the drop down menu?

  10. #10
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    Hi AB33 when i run the following amended code on the intended spreadsheet it deletes the content of the Data sheet
    and copies only one rep. Please note changed spread sheet


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Luphai; 01-22-2013 at 05:31 AM.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Luphai,
    Please use code tags as per forum's rule. Edit the above post. Highlight your code and click the icon # while I look at your request.

  12. #12
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    Done sorry

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    The reason why all the tabs have not been created is that you have / in rows 22-31 (Column P). VBA would not allow you to create names using a slash, so when the code reaches these rows it creates blank sheets.

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    01-17-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Split worksheet

    Thanks AB33

  15. #15
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split worksheet

    Luphai,
    I have tested the code by changing the names in rows 22-31 and the code has created tabs for each changed names, no blank sheets. In fact, you have lots of characters on names which are not permitted by VBA. I would advice you to change the names of these items. Please close this thread.

+ 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