I have a spreadsheet with formulas in 2000 rows. As data is filled (sequentially down the sheet), 'populated' rows are to be printed; 'unpopulated' rows are to be hidden.
I run the following before printing:
Sub HideRows()
Set CheckRange = ActiveSheet.Range ("B2:B2002")
For Each Checkcell in CheckRange
With Checkcell
If .Value = 0 Then
.EntireRow.Hidden = True
End If
End With
Next Checkcell
However, it takes quite a bit of time to check each row and hide it.
It seems like it would be easier to simply hide a range -- without any cell checking necessary.
If I create a "HideRange" range name,
1. How do I change the range parameters to include the newly populated row? (Initially, HideRange would include B2:B50. With newly populated data, the HideRange rows need to be B2:B51.)
2. What is the syntax for hiding a range?
Thanks. You're always most helpful.
swtrader
-- If you don't know where you're going, you'll always know when you're not there.
I run the following before printing:
Sub HideRows()
Set CheckRange = ActiveSheet.Range ("B2:B2002")
For Each Checkcell in CheckRange
With Checkcell
If .Value = 0 Then
.EntireRow.Hidden = True
End If
End With
Next Checkcell
However, it takes quite a bit of time to check each row and hide it.
It seems like it would be easier to simply hide a range -- without any cell checking necessary.
If I create a "HideRange" range name,
1. How do I change the range parameters to include the newly populated row? (Initially, HideRange would include B2:B50. With newly populated data, the HideRange rows need to be B2:B51.)
2. What is the syntax for hiding a range?
Thanks. You're always most helpful.
swtrader
-- If you don't know where you're going, you'll always know when you're not there.