Thread: Question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Question

Is it because you use

Debug.Print Target.Row

whereas your range object is called oCell, so you should use

Debug.Print oCell.Row


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"kirkm" wrote in message
...
Dim oCell As Excel.Range
Dim oSheet As Excel.Worksheet
Set oSheet = ActiveSheet


With Worksheets("MySheet")
For Each oCell in
oSheet.Range("F1:F30").SpecialCells(xlCellTypeCons tants)

Debug.Print Target.row
Next
End With

Stepping through this repeatedly prints 8. (Sometimes 11)

What makes it an 8, and why does it not move to the next row?

Thanks - Kirk