Custom format as ;;; to make text invisible but doesn't work with filter?

Melimob

Active Member
Joined
Oct 16, 2011
Messages
396
Office Version
  1. 365
Hi

I thought I had found an amazing solution to an issue whereby a column I wanted to filter had blank rows in between.
I autofilled the rows with the value above but as I didn't want the text to show no matter what the cell colour was changed to, I formatted the cells using custom ;;;

this worked great BUT...

Now that I'm filtering, it doesn't find those formatted cells? Only if I use 'contains' as the filter and then type the text but I don't want the user to have to do this each time?

Any advice gratefully received!

thank you
 
SOLVED

I played around with it and managed to figure it out so posting the final code here in case it helps anyone else:

Code:
Private Sub HideFont()
    Dim cell As Variant
    Dim rng As Range
    Set rng = Range("Table1[Country]")
    For Each cell In rng
       If cell.Font.Color <> vbBlack Then
       cell.Font.Color = cell.Interior.Color
       End If
    Next cell
End Sub


Sub UnhideFont()
    Dim cell As Variant
    Dim rng As Range
    Set rng = Range("Table1[Country]")
    For Each cell In rng
        If cell.Font.Color <> vbBlack Then
        cell.Font.Color = 50
       End If
    Next cell
End Sub

then my toggle is:

Code:
Private Sub ToggleButton2_Click()
If ToggleButton2.Value = True Then
 'This area contains the things you want to happen
'when the toggle button is not depressed
UnhideFont
Else
'This area contains the things you want to happen
'when the toggle button is depressed
 HideFont
  End If


End Sub

thank you all!
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,707
Messages
6,174,000
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top