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:
- Wildcards or values in a macro?
- Spell number in excel without macro - Guide
- Macros in excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
- Run macro when cell value changes by formula ✓ - Excel Forum
- Execute Macro On Calculated Cell change - Excel Forum
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
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