+ Reply to Thread
Results 1 to 6 of 6

Splitting Active Worksheet into multiple sheets

  1. #1
    Registered User
    Join Date
    08-05-2019
    Location
    london
    MS-Off Ver
    office 2016
    Posts
    27

    Question Splitting Active Worksheet into multiple sheets

    Hey Guys, I am trying to split a master worksheet which looks like this:

    I have attached a sample file onto this thread.

    I am basically trying to open a new sheet at every instance of the break in the current sheet, being the --------

    How would I go about doing this in VBA?

    Many thanks

    D
    Attached Images Attached Images

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Splitting Active Worksheet into multiple sheets

    You can upload your actual file or a mock-up by clicking 'Go Advanced' at the bottom of the reply box, then click 'Manage Attachments' and follow the menu. Then we can work with your actual data to provide a solution.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    08-05-2019
    Location
    london
    MS-Off Ver
    office 2016
    Posts
    27

    Re: Splitting Active Worksheet into multiple sheets

    Thanks for your reply

    I have attached a sample file onto this thread

    Kind Regards
    Attached Files Attached Files

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Splitting Active Worksheet into multiple sheets

    If you add a dashed line beneath the last group of data then this should do what you want.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! try this !


    A beginner starter demonstration according to the attachment as it is (no needs any mod) :

    PHP Code: 
    Sub Demo1()
               
    Dim Rg As RangeF&, R&
        
    With Sheet1.UsedRange.Rows
               Set Rg 
    = .Columns(1).Find("-*-", , xlValuesxlWhole)
            If 
    Not Rg Is Nothing Then
                    F 
    1
                    R 
    Rg.Row
                
    Do
                    
    Sheets.Add Sheets(Sheets.Count)
                   .
    Item(":" Rg(0).Row).Copy [A1]
                       
    Rg(2).Row
                       Set Rg 
    = .Columns(1).FindNext(Rg)
                
    Loop Until Rg.Row R
                       Set Rg 
    Nothing
                
    If <= .Count Then
                    Sheets
    .Add Sheets(Sheets.Count)
                   .
    Item(":" & .Count).Copy [A1]
                
    End If
            
    End If
        
    End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  6. #6
    Registered User
    Join Date
    08-05-2019
    Location
    london
    MS-Off Ver
    office 2016
    Posts
    27

    Re: Splitting Active Worksheet into multiple sheets

    Thank you so much guys!

+ 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. Name sheets up to 30 characters - Splitting Data to multiple sheets
    By karpik92 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2019, 10:31 PM
  2. Replies: 2
    Last Post: 02-08-2019, 03:08 AM
  3. Splitting a worksheet evenly and placing the split portions on new sheets>
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-11-2017, 03:37 PM
  4. List worksheet names in active worksheet By Excluding Specific Sheets
    By jagadeesh.rt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2014, 10:22 AM
  5. Splitting worksheet information to other sheets
    By Bulvers in forum Excel General
    Replies: 2
    Last Post: 12-17-2010, 08:17 AM
  6. [SOLVED] Splitting a sheet between multiple new sheets
    By Jon C in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2005, 10:06 AM
  7. Replies: 0
    Last Post: 03-01-2005, 05:05 PM

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