This code
works perfectly for every column AFTER colnum. When I change this line
to
the calculation
does not calculate correctly. It is something very simple I haven't been able to figure out yet.
That is, to use For i = colnum To 54 and have the formula calculate the correct balances on the current (colnum) and each successive cell column.
It's been a struggle. Can anyone help me with the correct formula that will include colnum
and not start the For loop at colnum +1 to have it come out right ?
Tried to keep it simple, but complete.
Thanks for anyone's help.
cr
Code:
Dim X As Range
Sheets("Budget").Select
For i = colnum + 1 To 54
Cells(30, i).Value = Cells(30, i - 1).Value - Cells(18, i).Value
If Cells(30, i) = 0 Then
MsgBox "Balance is 0 at col " & i & " " & " and week " & Cells(2, i)
Range(Cells(30, i + 1), Cells(30, 54)).ClearContents
Exit For
End If
Next
End Sub
Code:
For i = colnum + 1 To 54
Code:
For i = colnum To 54
Code:
Cells(30, i).Value = Cells(30, i - 1).Value - Cells(18, i).Value
That is, to use For i = colnum To 54 and have the formula calculate the correct balances on the current (colnum) and each successive cell column.
It's been a struggle. Can anyone help me with the correct formula that will include colnum
and not start the For loop at colnum +1 to have it come out right ?
Tried to keep it simple, but complete.
Thanks for anyone's help.
cr