Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate cell before moving to next cell
I have the following code :-
Check = True: Counter = 0: r = 50 ' Initialize variables. Do ' Outer loop. Do While Counter < 1137 ' Inner loop. r = 50 + Counter 'start row For C = 15 To 25 'start Column If Cells(r - 3, 1).Value = "Y" And Cells(r - 3, 2).Value = 3 Then Cells(r - 1, C).Clear If Cells(r, C).Value = 0 Then Cells(r - 1, C).Value = (Cells(r - 2, C).Value - Cells(r, C - 1).Value) _ + ((Cells(r - 2, C + 1).Value) * (Cells(r - 3, 11).Value) / 4) ElseIf (Cells(r, C).Value < (Cells(r - 2, C + 1).Value) * (Cells(r - 3, 11).Value) / 4) Then Cells(r - 1, C).Value = (Cells(r - 2, C + 1).Value + Cells(r - 2, C + 2).Value) End If End If Next C Counter = Counter + 4 ' Increment Counter. If Counter 1137 Then ' If condition is True. Check = False ' Set value of flag to False. Exit Do ' Exit inner loop. End If Loop Loop Until Check = False ' Exit outer loop immediately. But need the formula in Cellc(r,C) to recalculate before moving to next c. I have Autocalulate off as takes to long to run with Autocalulate On |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate cell before moving to next cell
add the line
Application.Calculate "Sliman" wrote in message ups.com... I have the following code :- Check = True: Counter = 0: r = 50 ' Initialize variables. Do ' Outer loop. Do While Counter < 1137 ' Inner loop. r = 50 + Counter 'start row For C = 15 To 25 'start Column If Cells(r - 3, 1).Value = "Y" And Cells(r - 3, 2).Value = 3 Then Cells(r - 1, C).Clear If Cells(r, C).Value = 0 Then Cells(r - 1, C).Value = (Cells(r - 2, C).Value - Cells(r, C - 1).Value) _ + ((Cells(r - 2, C + 1).Value) * (Cells(r - 3, 11).Value) / 4) ElseIf (Cells(r, C).Value < (Cells(r - 2, C + 1).Value) * (Cells(r - 3, 11).Value) / 4) Then Cells(r - 1, C).Value = (Cells(r - 2, C + 1).Value + Cells(r - 2, C + 2).Value) End If End If Next C Counter = Counter + 4 ' Increment Counter. If Counter 1137 Then ' If condition is True. Check = False ' Set value of flag to False. Exit Do ' Exit inner loop. End If Loop Loop Until Check = False ' Exit outer loop immediately. But need the formula in Cellc(r,C) to recalculate before moving to next c. I have Autocalulate off as takes to long to run with Autocalulate On |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Arrow keys moving whole excel sprdsht insted of from cell to cell | New Users to Excel | |||
Moving cell contents to new cell loses background color in old cel | Excel Discussion (Misc queries) | |||
Arrows not moving from cell to cell, when I push arrow columns m | Excel Discussion (Misc queries) | |||
Force user to enter data in cell before moving to next cell | New Users to Excel | |||
How to copy formatting when moving from cell to variable to another cell on another worksheet | Excel Programming |