I have a function which accepts fromRange and ToRange of an Excel cell. basically i want to read cell by cell values from the range.
suppose if i pass E2 and E9 i want to read in a loop something like Range(E2).value, Range(E3).value and so on till E9
How can i get the between cell addresses. Please help
You usually does not want to iterate over ranges one-by-one. there are tons of functions which work on ranges and so this example is definitly a poor one. You’d better use e.g Sum here but just to give you an idea. A range is a collection and you can iteratee over it with for each, You can also use for with index access. But this is at least a bit less “pain”