View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nanette[_2_] Nanette[_2_] is offline
external usenet poster
 
Posts: 2
Default How to loop through all ranges in a worksheet

I'm trying to programmatically determine if a range exists
in an existing workbook. I'm using the following code and
it's erroring out:

========
Set validationWkSht = ThisWorkbook.Worksheets
("Validation")
With validationWkSht
For i = 0 To .Range.Count
<stuff
Next i
End With
========

I'm getting "Compile Error: Argument not optional"
applying to ".Range.Count". Thing is, I'm trying to
use ".Range" as a collection because there's supposed to
be a range collection w/a count propery.

Can anyone help me here? Thanks.