Wildcards or values in a macro?
Closed
sworcester
Posts
2
Registration date
Tuesday November 22, 2016
Status
Member
Last seen
November 22, 2016
-
Nov 22, 2016 at 11:58 AM
Blocked Profile - Nov 22, 2016 at 04:58 PM
Blocked Profile - Nov 22, 2016 at 04:58 PM
Related:
- Excel macro forum
- Excel online macros - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Excel run macro on open - Guide
- Kernel for excel repair - Download - Backup and recovery
- Macro for number to words in excel - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
December 27, 2022
555
Nov 22, 2016 at 12:06 PM
Nov 22, 2016 at 12:06 PM
Hi Sworcester,
Use "Like" instead of "=" when using "*" as in:
If range("A1").value like "*Super*" then
or
If left(range("A1").value,5) = "Super" then
will work as well.
Best regards,
Trowa
Use "Like" instead of "=" when using "*" as in:
If range("A1").value like "*Super*" then
or
If left(range("A1").value,5) = "Super" then
will work as well.
Best regards,
Trowa
sworcester
Posts
2
Registration date
Tuesday November 22, 2016
Status
Member
Last seen
November 22, 2016
Nov 22, 2016 at 03:39 PM
Nov 22, 2016 at 03:39 PM
Here is kinda what gets spit out
Sub SMC_Sys()
'
' SMC_Sys Macro
'
'
ActiveSheet.Range("$A$1:$CH$52073").AutoFilter Field:=14, Criteria1:=Array( _
"Vendor 1", "vendor 2", "another", "yet another", _
etc etc etc... ), Operator:= _
xlFilterValues
End Sub
I am trying to not have to alter much or write much, instead using the RECORD function to d most of the work. The idea is to create a macro that is portable for every month so the RANGE may change each month as well
Sub SMC_Sys()
'
' SMC_Sys Macro
'
'
ActiveSheet.Range("$A$1:$CH$52073").AutoFilter Field:=14, Criteria1:=Array( _
"Vendor 1", "vendor 2", "another", "yet another", _
etc etc etc... ), Operator:= _
xlFilterValues
End Sub
I am trying to not have to alter much or write much, instead using the RECORD function to d most of the work. The idea is to create a macro that is portable for every month so the RANGE may change each month as well