Solved

Split sheet out 0-26

Posted on 2013-12-12
5
182 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
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 31

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now