Thread: Cells V Range
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Cells V Range


Don't select or activate the range...

set WS = Worksheets(somesheetnameornumber)
With WS

..Cells(8, 9).CopyFromRecordset rs

End With

---- assuming that there are records in the RS!!

and yes, you can also use
..Range("L8").CopyFromRecordset rs


You are correct Range and cells are sysnonymous
Range(Range("B2"),Range("E7"))
Range(Range("B2"),cells(7,"E"))
Range(Range("B2"),cells(7,5))
Range(Cells(2,2),cells(7,"E"))
Range(cells(7,"E"),Range("B2"))

Patrick Molloy
Microsoft Excel MVP



-----Original Message-----
Hi

I have an interesting problem. I am populating an Excel
template from an Access database using
..Range(.Cells(8, 9), .Cells(8, 10)).select
..Range(.Cells(8, 9), .Cells(8, 10)).CopyFromRecordset rs

All appears to work fine. When I open the Excel sheet,

it
doesn't seem like any of the data has been populated.

BUT
if I go to my immediate window, then cells(8,9) shows me
the value that should have been pasted in, but range

("L9")
shows me the old value that should have been overwritten

I was under the impression that Cells and Range were a
synonymous way of refering to the same thing???

Any help would be appreciated.


.