+ Reply to Thread
Results 1 to 4 of 4

Need a macro to split 5020 codes into groups by 220 each

  1. #1
    Forum Contributor
    Join Date
    05-01-2014
    Location
    RIX
    MS-Off Ver
    Excel 2003; 2007
    Posts
    114

    Need a macro to split 5020 codes into groups by 220 each

    Hi!

    There are 5020 codes with supplier names in the worksheet.

    I'd like to split the codes in the calendar - so that every day includes 220 codes.

    See the file with more detailed info. attached.MACROS_SPLIT_CODES.xls
    Regards

    Arty

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need a macro to split 5020 codes into groups by 220 each

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-01-2014
    Location
    RIX
    MS-Off Ver
    Excel 2003; 2007
    Posts
    114

    Re: Need a macro to split 5020 codes into groups by 220 each

    John you're genius! It works great!

    Additional question - which number I have to change to set everyday's limit from 220 to e.g. 350?

    As far as I understand it's (bold):

    Sub Split_by_Artis()
    Dim i As Long
    Dim x As Long
    Dim y As Long
    x = 7
    Columns(2).Copy
    Columns(1).Insert
    Columns(2).Copy
    Columns(2).Insert
    For i = Range("A" & Rows.Count).End(3).Row To 3 Step -1
    If Range("A" & i) = Range("A" & i).Offset(1) Then Range("A" & i).Offset(1).ClearContents
    Next i
    y = Range("B" & Rows.Count).End(3).Row / 350Do Until y = 0
    Range("A2:B221").Copy Cells(3, x)
    If Cells(3, x) = "" Then Cells(3, x) = Cells(Rows.Count, x - 2).End(3).Value
    Range("A2:B351").Delete xlUp
    x = x + 2
    y = y - 1
    Loop
    Columns("A:B").Delete
    End Sub

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need a macro to split 5020 codes into groups by 220 each

    You're welcome. Glad to help out and thanks for the feedback. You figured your question out. Please comply with Forum Rules about posting code. Review for Rule 3.

    http://www.excelforum.com/forum-rule...rum-rules.html

+ 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. [SOLVED] Split percentages into groups of 10 for 5 segments
    By dchubbock in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-11-2014, 06:56 PM
  2. [SOLVED] macro to split up HTML codes
    By MrCardinal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-05-2013, 09:39 PM
  3. Split Data into User Defined Groups
    By clacketyclack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2012, 04:37 PM
  4. Assigning job codes into corresponding job code groups
    By ngiachino in forum Excel General
    Replies: 4
    Last Post: 03-11-2009, 03:39 PM
  5. split:ZIP CODES
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07: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