LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Norman Jones
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Cell Value Based on Another Cell T or F DocuMike Excel Discussion (Misc queries) 3 January 5th 05 08:46 PM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 01:01 PM
Hide text that doesn't fit in the cell Rene Excel Discussion (Misc queries) 1 December 16th 04 04:34 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
Returning a Value to a Cell Based on a Range of Uncertain Size amc422 Excel Worksheet Functions 7 November 14th 04 03:03 PM


All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"