jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
All, I have a table query named
Where I'm pulling data out of Syspro, The header name in cell B2 is "JOB" I have a job number in Cell B1 that I would like to filter the table with. Right now I have filters on the table and can copy paste B1 into the filter on B2 and it does what I want. Normally I record those steps and save the macro add a button and then people use it.
Here is what I get but want what ever is in B2 as the criteria not 20222026 all the time
Sub Macro12
'
' Macro12 Macro
'
'
Table_Query_from_SysproServer5 |
Where I'm pulling data out of Syspro, The header name in cell B2 is "JOB" I have a job number in Cell B1 that I would like to filter the table with. Right now I have filters on the table and can copy paste B1 into the filter on B2 and it does what I want. Normally I record those steps and save the macro add a button and then people use it.
Here is what I get but want what ever is in B2 as the criteria not 20222026 all the time
Sub Macro12
'
' Macro12 Macro
'
'
SQL:
Range("B1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.ListObjects("Table_Query_from_SysproServer5").Range.AutoFilter _
Field:=1, Criteria1:="20222026"
End Sub