• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

One sheet into multiple sheets based on criteria

Mohandas

Member
I want to copy the data into different sheets based on the name as criteria

I have pasted the data of one customer i want the data to paste the data of all customers


for one customer one sheet
 

Attachments

  • exl dump 0509.XLSX
    68 KB · Views: 5
Mohandas
I would ask ... why ... ?
... but ... I try to be patient ...
Here is one sample ... press [ Do It ]-button
 

Attachments

  • exl dump 0509.xlsb
    52.9 KB · Views: 4
See button in attached, which runs the following:
Code:
Sub blah()
'Application.ScreenUpdating = False 'include this line and the last line of this macro to speed it up
Set RngToFilter = Sheets("Sheet1").Range("A1").CurrentRegion.Resize(, 11)
RngToFilter.Columns(10).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheets("Sheet1").Range("Q1"), Unique:=True
Set AllCritRng = Sheets("Sheet1").Range("Q1").CurrentRegion
Set RngCrit = AllCritRng.Resize(2, 1)
For Each cll In Intersect(AllCritRng, AllCritRng.Offset(1)).Cells
  RngCrit.Cells(2).Value = cll.Value
  With Sheets.Add(After:=Sheets(Sheets.Count))
    RngToFilter.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=RngCrit, CopyToRange:=.Range("A1"), Unique:=False
    .Name = Left(cll.Value, 31)
    .Columns("A:K").AutoFit
  End With
Next cll
AllCritRng.Clear
'Application.ScreenUpdating = True 'include this line and the first line of this macro to speed it up
End Sub
 

Attachments

  • Chandoo42523exl dump 0509.xlsm
    72.1 KB · Views: 9
Back
Top