Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
Hi Reddance,
Try instead: Sub Tester() Dim rng As Range Dim i As Long If LCase(Sheets("Ctrl").Range("A1").Value) _ < "yes" Then Exit Sub End If With Sheets("ToPrint") For i = 5 To .UsedRange.Rows.Count Step 2 If Not rng Is Nothing Then Set rng = Union(rng, .Cells(i, "A")) Else Set rng = .Cells(i, "A") End If Next i End With If Not rng Is Nothing Then rng.EntireRow.Hidden = True End If End Sub --- Regards, Norman "Norman Jones" wrote in message news:... Hi Reddiance, Try: Sub Tester() Dim rng As Range Dim i As Long If LCase(Sheets("Ctrl").Range("A1").Value) _ < "yes" Then Exit Sub End If For i = 5 To Sheets("ToPrint").UsedRange.Rows.Count Step 2 If Not rng Is Nothing Then Set rng = Union(rng, Cells(i, "A")) Else Set rng = Cells(i, "A") End If Next i If Not rng Is Nothing Then rng.EntireRow.Hidden = True End If End Sub --- Regards, Norman |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Cell Value Based on Another Cell T or F | Excel Discussion (Misc queries) | |||
make a cell empty based on condition | Charts and Charting in Excel | |||
Hide text that doesn't fit in the cell | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions | |||
Returning a Value to a Cell Based on a Range of Uncertain Size | Excel Worksheet Functions |