J
John Putman
I'm just starting to convert an Excel addin that was
written in VBA to C#. I have two issues I am having
trouble with so far...
First.... I tried to copy the old VBA code that takes a
Range and then does a Find for a specific string within
the formulas of that Range. While the Find method is
finding cells with that string in the formula, it is
finding them outside of the specified range. For
instance, I grabbed the Selection range and did a Find on
it and it found a cell outside of the selection Range that
complied with the criteria. I need to know how to limit
it to just that certain Range.
In leiu of being able to do that, I tried iterating
through the Range one cell at a time, as I would have in
VBA using a foreach. It throws an error when I try
something like:
foreach (Excel.Range aCell in aCurrentRange)
The error says that 'Member cannot be found.' Perhaps C#
doesn't recognize the Range object as a collection like
VBA??? How can I iterate through a Range?
thanks for your help... I'm sure I'm just doing something
stupid on both counts
written in VBA to C#. I have two issues I am having
trouble with so far...
First.... I tried to copy the old VBA code that takes a
Range and then does a Find for a specific string within
the formulas of that Range. While the Find method is
finding cells with that string in the formula, it is
finding them outside of the specified range. For
instance, I grabbed the Selection range and did a Find on
it and it found a cell outside of the selection Range that
complied with the criteria. I need to know how to limit
it to just that certain Range.
In leiu of being able to do that, I tried iterating
through the Range one cell at a time, as I would have in
VBA using a foreach. It throws an error when I try
something like:
foreach (Excel.Range aCell in aCurrentRange)
The error says that 'Member cannot be found.' Perhaps C#
doesn't recognize the Range object as a collection like
VBA??? How can I iterate through a Range?
thanks for your help... I'm sure I'm just doing something
stupid on both counts
