Hi,
I found an macro online that works perfect in splitting the data into multiple sheets based on Column "S". However I only need selected columns to go to the other sheets vs the current all data in Raw file.
I only want the following column to be split "A:B" "E" "H" "J" "N:O" "R:T" only these columns should move.
I found an macro online that works perfect in splitting the data into multiple sheets based on Column "S". However I only need selected columns to go to the other sheets vs the current all data in Raw file.
I only want the following column to be split "A:B" "E" "H" "J" "N:O" "R:T" only these columns should move.
Code:
[/COLOR][COLOR=#333333].Cells(Rows.Count, c).End(xlUp).Row[/COLOR]
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">
ws.Cells(1, c).Resize(r1).Sort Key1:=ws.Cells(1, c), Header:=xlYes
ws.AutoFilterMode = False
Application.DisplayAlerts = False
For x = 2 To r1
For Each ws1 In Sheets
If ws1.Name = ws.Cells(x, c) Then ws1.Delete
Next
Next
Application.DisplayAlerts = True
For x = 2 To r1
ws.Range(ws.Cells(1, sCol), ws.Cells(r, sCol)).AutoFilter Field:=1, Criteria1:=ws.Cells(x, c)
Set ws1 = Worksheets.Add(after:=Worksheets(Worksheets.Count))
ws1.Name = ws.Cells(x, c).Value
rng.SpecialCells(xlCellTypeVisible).Copy
Range("A1").PasteSpecial Paste:=xlPasteFormats
Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Next x
With ws
.AutoFilterMode = False
.Cells(1, c).Resize(r).ClearContents
.Activate
.Range("A1").Select
End With
Application.ScreenUpdating = True
</code>[COLOR=#333333]End Sub[/COLOR][COLOR=#333333]