?
Solved

Split sheet out 0-26

Posted on 2013-12-12
5
Medium Priority
?
201 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

770 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