I'm very beginner in VBA and i have an autofilter macro that will filter based on the user input. A new spreadsheet will be generated and the filtered data will be paste on the new spreadsheet.
But the problem that i have is like so :
-------------------------------------------------
Example of data:
Name Model PO Number
Kevin Winon 3000
Billy Kent 3001
Esther Kent 3000
Tom Master 3005
For example if the filtered criteria = 3000
Output receive is:
Name Model PO Number
Billy Kent 3001
Tom Master 3005
Desired output
Name Model PO Number
Kevin Winon 3000
Esther Kent 3000
---------------------------------------------------------------
My Code :
Sub po_finder()
Dim po_num As String
Sheets("Analysis").Unprotect "mech_eng_123"
po_num = UserForm_PO.TextBox1.Value
Sheets("Analysis").Select
ActiveSheet.Range("W1").AutoFilter Field:=23, Criteria1:=po_number
ActiveSheet.Range("A1:AW500").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Analysis").AutoFilterMode = False
End Sub