Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells V Range
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells V Range
Cj wrote:
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 Cells(8, 9) is cell "I8" - row 8, column 9 Not surprising that L9 was not changed! Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cells V Range
Patrick Molloy wrote
You are correct Range and cells are sysnonymous Range(Range("B2"),Range("E7")) OT, but can I reference this one this way? Range("B2,E7") -- David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summing a range of cells based on criteria in another range | Excel Worksheet Functions | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
Count cells in one range based on parameters in another range | Excel Worksheet Functions |