View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dev dev is offline
external usenet poster
 
Posts: 66
Default How to get individual range objects from a set of range object

I tried the same thing from C# - I am getting "Member not found" exception.

foreach (Excel1.Range range in r)
{
string cellAddress = ((Excel1.Range)range.Cells).get_Address
(Type.Missing, Type.Missing, Excel1.XlReferenceStyle.xlA1,Type.Missing,
Type.Missing);
h.Add(cellAddress);
}

"Tom Ogilvy" wrote:

dim myrange as range, cell as range

set myRange = Worksheets("Sheet1").Range("B15:B17")
for each cell in MyRange
msgbox cell.Address
Next

'to refer to the 2nd cell in the range
msgbox myRange(2)

--
Regards,
Tom Ogilvy


"Dev" wrote:

I set up myRange to contigious cells - now how do I get individual range
objects from it?
Ex: I set myRange = Worksheets("Sheet1").Range("B15:B17") - now I want to
get B15, B16; B17. Is there any way to get this using Excel OM?

Thanks for any suggestion!