Thread: Set RNG
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 40
Default Set RNG

This code works to count hidden rows. But how can I set the range when I call
the function rather than have a spectific range in the code itself.

Function CountHidden()
Dim CellCount As Long
CellCount = 0
Set RNG = Range("a1:a9")
For Each Cell In RNG
If Cell.EntireRow.Hidden Then
CellCount = CellCount + 1
End If
Next Cell
CountHidden = CellCount
End Function
--
Howard