I have a large dataset that I want to filter by values in column A.
I then wish to copy all values within that filter to a new worksheet in the same workbook.
I wish to name the worksheet after the filtered value.
I then wish to repeat this for all unique values within the dataset, each time transferring the next dataset to another new worksheet and name the given sheet after the unique filter value.
I've recorded this, but non of it has unique values or anything that makes it flexible.
I'd be real pleased for someone's help!
-----------------------------------------------------------------------------
Sub FilterCPY_PST()
'
' FilterCPY_PST Macro
'
' Keyboard Shortcut: Ctrl+r
'
Columns("A:A").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$A$7879").AutoFilter Field:=1, Criteria1:= _
"0_50m_sc1_B10_00m"
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
End Sub
I then wish to copy all values within that filter to a new worksheet in the same workbook.
I wish to name the worksheet after the filtered value.
I then wish to repeat this for all unique values within the dataset, each time transferring the next dataset to another new worksheet and name the given sheet after the unique filter value.
I've recorded this, but non of it has unique values or anything that makes it flexible.
I'd be real pleased for someone's help!
-----------------------------------------------------------------------------
Sub FilterCPY_PST()
'
' FilterCPY_PST Macro
'
' Keyboard Shortcut: Ctrl+r
'
Columns("A:A").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$A$7879").AutoFilter Field:=1, Criteria1:= _
"0_50m_sc1_B10_00m"
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
End Sub