+ Reply to Thread
Results 1 to 4 of 4

Split data into multiple worksheets.

  1. #1
    Registered User
    Join Date
    03-03-2020
    Location
    Kazakhstan
    MS-Off Ver
    10
    Posts
    3

    Question Split data into multiple worksheets.

    I'm trying to split a big list of data into multiple worksheets by row count of every 44 of data. Also, I want to copy the first row (heading) to every new worksheet.

    The problem is that I can't understand what is wrong with the code. It process the first 44 rows, stops and shows "Run Time Error 1004".
    When I click debug, it shows this row: --> Range(.Range("A1:C1").Address(0, 0) & "," & .Range(Cells(i, "A"), Cells(i, "C").Resize(44)).Address(0, 0)).Copy


    Sub test()
    Dim iCalc As Long, i As Long

    iCalc = Application.Calculation
    With Application
    .Calculation = xlManual
    .ScreenUpdating = False
    .EnableEvents = False
    End With

    With ThisWorkbook.ActiveSheet
    For i = 2 To .Range("A" & Rows.Count).End(xlUp).Row Step 44
    Range(.Range("A1:C1").Address(0, 0) & "," & .Range(Cells(i, "A"), Cells(i, "C").Resize(44)).Address(0, 0)).Copy
    Worksheets.Add
    Range("A1").PasteSpecial xlPasteValues
    Next i
    End With
    With Application
    .Calculation = iCalc
    .ScreenUpdating = True
    .EnableEvents = True
    End With
    End Sub
    Last edited by harnolds; 03-04-2020 at 05:46 AM.

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

    Re: Split data into multiple worksheets.

    Try this macro. Change the sheet name (in red) to suit your needs.
    Please Login or Register  to view this content.
    Last edited by Mumps1; 03-03-2020 at 04:58 PM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    03-03-2020
    Location
    Kazakhstan
    MS-Off Ver
    10
    Posts
    3

    Re: Split data into multiple worksheets.

    Thanks a lot! It worked!!!
    Last edited by harnolds; 03-04-2020 at 05:44 AM.

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

    Re: Split data into multiple worksheets.

    You are very welcome.

+ 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. How to Split Data into Multiple Worksheets with Set Number of Rows and Same Header
    By highstar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2020, 07:58 AM
  2. [SOLVED] Split data into multiple worksheets
    By yogyata26 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2019, 04:14 AM
  3. [SOLVED] Need vba to split data into multiple worksheets based on column of P & save wb with FY 16
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2016, 05:47 AM
  4. [SOLVED] Split Data into Multiple Worksheets by row count of every 900
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2014, 02:02 AM
  5. [SOLVED] Split data into multiple worksheets based empty row
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2014, 04:59 AM
  6. Split Date into Multiple Worksheets based on Data
    By keithm_007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2014, 12:00 PM
  7. [SOLVED] Split data in one worksheets into multiple sheets?
    By cahillct in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-14-2012, 07:51 AM

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