Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrow keys moving whole excel sprdsht insted of from cell to cell Ms-Exl-Learner New Users to Excel 2 December 17th 09 07:20 AM
Moving cell contents to new cell loses background color in old cel John Excel Discussion (Misc queries) 4 May 11th 09 01:56 AM
Arrows not moving from cell to cell, when I push arrow columns m Luanne Excel Discussion (Misc queries) 2 December 11th 08 07:24 PM
Force user to enter data in cell before moving to next cell Fusionmags New Users to Excel 3 November 19th 06 11:49 PM
How to copy formatting when moving from cell to variable to another cell on another worksheet kls[_2_] Excel Programming 1 September 11th 04 10:42 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"