View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_14_] Bob Phillips[_14_] is offline
external usenet poster
 
Posts: 216
Default How do range objects work?

Also, when you set the range you should fully qualify it

With Sheet1
Set nGrid = Union(.Range(.Cells(ntRow, gsLft), .Cells(ntRow, gsLft +
12)), _
.Range(.Cells(nbRow, gsLft), .Cells(nbRow, gsLft + 12)))
End With



--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

wrote in message
oups.com...
Hi
.Cells, like .offset, is relative to the range but does not have to be
in the range. This is a feature not a bug(!).
To stay in the range you want something like
For each Cell in nGrid
i = i + i
Cell.Value = i
next Cell

This fills across the row before going to the next row.

regards
Paul