PDA

View Full Version : Hide rows with bold text



Ethan
07-16-2012, 12:20 PM
Hello all,

I'd like to hide rows that have text in bold in column N
The range is N26:N85

Is this possible?

CodeNinja
07-16-2012, 12:31 PM
Ethan,
Try this:

Sub test()
Dim i As Integer
For i = 26 To 85
If Sheet1.Cells(i, "N").Font.Bold = True Then Sheet1.Range("A" & i).EntireRow.Hidden = True

Next i

End Sub

Ethan
07-16-2012, 12:46 PM
Wow, thank you CodeNinja!
Last question: How to use it for non-bold only?

Ethan
07-16-2012, 12:49 PM
I tried .Font.Regular but that did not work

Ethan
07-16-2012, 12:53 PM
Sorry for that it should be offcourse
Font.Bold = False Then...

:banghead:

CodeNinja
07-16-2012, 01:18 PM
Good for you figuring that out!