J
John Black
I know this is a simple thing but I can't make the syntax work. I am passed a range into a
function that is 3 columns wide and some variable number of rows long.
The For loop is just trying to run through each of the rows in the range and pull the values
from the 3 columns in each row into variables to do some calculations.
Function WAR(Sel As Range) As Double
Y = Sel.Rows.Count
For i = 0 To (Y - 1)
A = Sel.Offset(i, 0).Value
B = Sel.Offset(i, 1).Value
C = Sel.Offset(i, 2).Value
Use values...
Next i
....
But this is not working. Can I not use Offset(x,y) to move around within the range Sel? If
not, now do I reference values at a given x,y coordinate within the range? Thanks.
John Black
function that is 3 columns wide and some variable number of rows long.
The For loop is just trying to run through each of the rows in the range and pull the values
from the 3 columns in each row into variables to do some calculations.
Function WAR(Sel As Range) As Double
Y = Sel.Rows.Count
For i = 0 To (Y - 1)
A = Sel.Offset(i, 0).Value
B = Sel.Offset(i, 1).Value
C = Sel.Offset(i, 2).Value
Use values...
Next i
....
But this is not working. Can I not use Offset(x,y) to move around within the range Sel? If
not, now do I reference values at a given x,y coordinate within the range? Thanks.
John Black