+ Reply to Thread
Results 1 to 4 of 4

Need help to modify the code so that it splits the workbook into individual worksheet

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    Melbourne, Oz
    MS-Off Ver
    Excel 2007
    Posts
    80

    Need help to modify the code so that it splits the workbook into individual worksheet

    I have a workbook with the following worksheets “PreviousFN”, “CurrentFN”, “OmittedMbrs”, “NewMbrs”, “CommonEID” , “PayPeriod”, “Section” and “ImportHere”

    I want to split this workbook create workbooks but I don’t want to create all the workbooks. I want to create “PreviousFN”, “CurrentFN”, “OmittedMbrs”, “NewMbrs” and “CommonEID” only and only if they have data in each worksheet. They all have headings.

    The present code is creating workbooks of all the sheets. I don’t want to create “PayPeriod”, “Section” and “ImportHere”. "CommonEID" does not have the data.

    Please, I need help to modify the code to do so.

    Please Login or Register  to view this content.

    Thank you regards.

    Raghu

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Need help to modify the code so that it splits the workbook into individual worksheet

    Hi

    to clarify
    • do you want to create a new workbook for each of the sheets you name, each workbook containing one sheet only; or
    • do you want one workbook with each of the sheets you name, but only if they contain data other than headings

    and
    • are your headings in a single row at the top of the sheet (so any sheet with more than one row in its used range contains data?)

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: Need help to modify the code so that it splits the workbook into individual worksheet

    I guess easiest is checking to see if there is anything in A2
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Need help to modify the code so that it splits the workbook into individual worksheet

    Please Login or Register  to view this content.
    dont know how to justify if something has data?
    anyway you could easier add something before the xWs.Copy line to check if xWs has "data"
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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. Modify Worksheet VBA Code
    By ibuworks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2016, 09:41 AM
  2. Modify code to pull from a different workbook
    By AWITCHER in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2014, 02:53 PM
  3. EDIT either individual worksheet or workbook version
    By Southernw2002 in forum Excel General
    Replies: 3
    Last Post: 08-12-2013, 01:38 AM
  4. [SOLVED] VBA code closes application and not individual workbook
    By brharrii in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-03-2013, 04:17 PM
  5. Replies: 2
    Last Post: 11-26-2012, 03:44 AM
  6. [SOLVED] Save Every Worksheet in a Workbook to individual PDF files that use the worksheet name
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2012, 12:00 AM
  7. Modify This Code for WorkBook Loop
    By Pukka83 in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 06-24-2008, 05:39 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