DutchKevin
Board Regular
- Joined
- Apr 13, 2011
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Hello All,
For a table that i have I use below code to filter based on column titels. Showing only columns that meat the criteria in row 8.
However this currently only works for an exact match (I already managed to get around the case sensitivity).
I would need a code that filters for part of the vaulue.
Lets say I enter "Text1" as a search criteria in cell C8, I need the code to show all colums where in row 8 the "text1" is part of the value. So showing also "text11" and Text1A" for example.
I can't get my head around how to use the wildcards properly.
Do you have any suggestions??
Thanks
Kevin
For a table that i have I use below code to filter based on column titels. Showing only columns that meat the criteria in row 8.
However this currently only works for an exact match (I already managed to get around the case sensitivity).
I would need a code that filters for part of the vaulue.
Lets say I enter "Text1" as a search criteria in cell C8, I need the code to show all colums where in row 8 the "text1" is part of the value. So showing also "text11" and Text1A" for example.
I can't get my head around how to use the wildcards properly.
Do you have any suggestions??
Thanks
Kevin
Code:
If (LCase(Cells(8, n).Value)) = LCase(Range("c8").Value) Then 'note the explicit Lowercase command
Cells(8, n).EntireColumn.Hidden = False
Else: Cells(8, n).EntireColumn.Hidden = True
End If