# VBA Hide Rows with Bold Text



## bored622 (Jan 6, 2023)

Hello, I'm trying to create a macro that hides rows with bold text after row six. Also, another macro button that unhides the rows.


----------



## DanteAmor (Jan 7, 2023)

bored622 said:


> after row six


But which column?

*For column A:*

```
Sub hiderows()
  Dim c As Range
  For Each c In Range("A6", Range("A" & Rows.Count).End(3))
    If c.Font.Bold Then
      c.EntireRow.Hidden = True
    End If
  Next
End Sub
```

*If you want to review all cells with values in your sheet:*

```
Sub hiderows2()
  Dim lr As Long, lc As Long
  Dim c As Range
  lr = Cells.Find("*", , xlValues, xlPart, xlByRows, xlPrevious).Row
  lc = Cells.Find("*", , xlValues, xlPart, xlByColumns, xlPrevious).Column
  For Each c In Range("A6", Cells(lr, lc)).SpecialCells(xlCellTypeConstants)
    If c.Font.Bold Then
      c.EntireRow.Hidden = True
    End If
  Next
End Sub
```

*Unhides the rows.*

```
Sub unhide()
  ActiveSheet.Cells.EntireRow.Hidden = False
End Sub
```


----------

