returning contents of cells


Posted by Barry Ward on August 14, 2001 7:53 AM


How do I return the text in cells when using ranges?

eg

Range("d2" & ":" & "f1").Select

where "d2"= R1C1 and "f1" = R2C2

Posted by Damon Ostrander on August 14, 2001 10:08 AM

Ho Barry,

Unfortunately you cannot use R1C1-style references with the Range method. This is because the Cells method already covers the situation where you know what the row and column indices are. If you change the cell contents to A1-style references (i.e., A1 and B2 instead of R1C1 and R2C2) then the following can be used:

Range(Range([d2]), Range([f1])).Select

If you must work with R1C1-style references, you will have to write code to parse out the row and column indices and use the Cells method:

Range(Cells(R1,C1),Cells(R2,C2)).Select

Happy computing.

Damon

How do I return the text in cells when using ranges?



Posted by Barry Ward on August 15, 2001 12:57 AM

OK Thanks.....

: : How do I return the text in cells when using ranges? : eg : Range("d2" & ":" & "f1").Select : where "d2"= R1C1 and "f1" = R2C2