I have the following loop in a UDF function,
I have 10 cells in 2 separate columns highlighted for my range and date variables. This code doesn't work if I start at j=0, but the first entry I want to loop with is in the cell j=0. Any advice on how to structure this?
Code:
Function(entry as Range, date as Range)
Dim answer as Variant
For j=1 to 10
IF something THEN
answer = entry(j)
IF something else THEN Exit For
End If
End If
Next j
I have 10 cells in 2 separate columns highlighted for my range and date variables. This code doesn't work if I start at j=0, but the first entry I want to loop with is in the cell j=0. Any advice on how to structure this?