View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Inconsistency in how Range object is accepted?

cells must be qualified as well

With WorksheetsToFormat(N)
With .Range(.Cells(2,1),.Cells(65536,7))


End With
End With


or

With WorksheetsToFormat(N).Range("A2").Resize(65535,7)


--
Regards,
Tom Ogilvy


"Chris B" wrote in message
...
Why is it that this statement is acceptable:

With WorksheetsToFormat(N).Range("A2:G65536")

But this one isn't?

With WorksheetsToFormat(N).Range(Cells(2,1),Cells(65536 ,7))

When I try to use the second one, I get an error that the Range object

failed.

WorksheetsToFormat is declared as:
Dim WorksheetsToFormat(1 to 8) as Worksheet