Solved

Split sheet out 0-26

Posted on 2013-12-12
5
186 Views
Last Modified: 2013-12-12
Hi,

I have a wb with 27 client types, 161k rows of data on sheet 1

I would like a macro that can split the data out in ascending order 0,1,2,3,4 etc

So my first tab will be the full data and then the other tabs, starting at 0,1,2 etc etc

Any ideas?

Thanks
0
Comment
Question by:Seamus2626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 11

Expert Comment

by:Angelp1ay
ID: 39714231
Hi Seamus.

I think we need a little more information about the problem and if possible an example workbook. What are your columns?!?
0
 

Author Comment

by:Seamus2626
ID: 39714239
Apologies, i forgot the wb
Client-Types-EE.zip
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39714305
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39714777
Sub Filtertosheets()
Dim rng As Range
Dim sws As Worksheet
Set sws = ActiveSheet
Set rng = Range("A1")
'Sheet1.Cells.Copy Sheet2.Cells
rng.EntireColumn.Insert
Range(rng.Offset(, -1), rng.End(xlDown).Offset(, -1)).Formula = "=row()"
Range(rng.Offset(, -1), rng.End(xlDown).Offset(, -1)).Value = Range(rng.Offset(, -1), rng.End(xlDown).Offset(, -1)).Value
rng.CurrentRegion.Sort key1:=rng, order1:=xlAscending, key2:=rng.Offset(, -1), order2:=xlAscending, Header:=xlYes
For i = 0 To 26
Sheets.Add , Sheets(Sheets.Count)
ActiveSheet.Name = "CT" & i
    rng.CurrentRegion.AutoFilter Field:=2, Criteria1:=i
    rng.CurrentRegion.Offset(, 1).SpecialCells(xlCellTypeVisible).Copy Range("A1")
Next i
sws.Select
rng.AutoFilter
rng.CurrentRegion.Sort key1:=rng.Offset(, -1), order1:=xlAscending, Header:=xlYes
rng.Offset(, -1).EntireColumn.Delete
End Sub

Open in new window

0
 

Author Closing Comment

by:Seamus2626
ID: 39714838
Hero!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question