iterating through a range in excel

B

Bob

Hi,
Does anyone know how to iterate through the individual cells in an
excel Range? I believe I have a non-contiguous range from a function
call so I don't know the rows and column indices and can't use them.

Thanks,
Bob
 
B

Bob

Hi,
Does anyone know how to iterate through the individual cells in an
excel Range? I believe I have a non-contiguous range from a function
call so I don't know the rows and column indices and can't use them.

Thanks,
Bob

Nevermind, I figured it out:

foreach (Range r in precedents)
{
Debug.Print(r.get_Address(true, true,
XlReferenceStyle.xlA1, false, Missing.Value));
//object pls= r.Value2;
//Debug.Print(pls.ToString());

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top