sudeepa123
New Member
- Joined
- Jun 25, 2011
- Messages
- 2
In a workbook with Multiple worksheets I need to hide certain rows in a range whose T$rownum cell is coloured . I need help with that .Here is the code I am working with .
Sub hide_rows()
Dim Rng As Range
Dim MyCell As Range
Dim Sht As Worksheet
Set Sht = ThisWorkbook.Sheets(9)
Set Rng = Sht.Range("T5:T204")
For Each MyCell In Rng
If MyCell.Interior.Colorindex = 22 Then
MyCell.EntireRow.Hidden = True
End If
Next MyCell
End Sub
Sub hide_rows()
Dim Rng As Range
Dim MyCell As Range
Dim Sht As Worksheet
Set Sht = ThisWorkbook.Sheets(9)
Set Rng = Sht.Range("T5:T204")
For Each MyCell In Rng
If MyCell.Interior.Colorindex = 22 Then
MyCell.EntireRow.Hidden = True
End If
Next MyCell
End Sub