PDA

View Full Version : Copy filtered data in new sheet and name it after criteria



teodormircea
02-20-2009, 08:00 AM
Hello every One
I'm trying to make a code that will copy in a new sheet all the values filtered, and name the new sheet after all criteria used in filter
Here i attached my file.
the code can find the first criteria but not the second

Thanks for all help

venkat1926
03-07-2009, 07:13 PM
I do not know what filter you have used. use "advance filter". see help under this.

mdmackillop
03-08-2009, 03:39 AM
Call the second sub from the first, passing the new sheet name.
Sub Filter()
'........................
Filter_Create Crit1 & " " & crit2
End Sub

Sub Filter_Create(ShName)
'..........................
' Add a new worksheet to copy the filter results in.
Set WSNew = Worksheets.Add
WSNew.Name = ShName
'..........................
End Sub