I am writing a program which would take in a range as an input and do some calculations from the value of cells in the selected range.
I am able to get this as long as I give a single range as input but i get an error for range with multiple areas. What could be done about this.
Here's simplified version of my program (which only calculates SUM but that is not what I want to do)
Dim rRange as range
running_total = 0
set rRange = Range("A1")
Dim rcell As Range
For Each rcell In rRange
running_total = running_total + rcell.Value
Next rcell
if I set
rRange = Range("A1:A10") ---- Pass
rRange = Range("A1, A2, A3") ---- Fail
rRange = Range("A1:D10") ---- Pass
rRange = Range("A1:A10,D1:D10") --- Fail
Please let me know how can i get around this.
Thank you
Bookmarks