View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sharad Sharad is offline
external usenet poster
 
Posts: 123
Default Delaying until Recalcu code is done.

Let me get it clear first.
You have a procedure (Procedure1) in which you write to the cell. Then
you have another procedure (Procedure2) fired by the change in the cell
(may be worksheet_chage).
Right?

So what you do is.
1. If there is no module in your vba project insert a module.
2. At module level declare a public vairable as under -
Public canInow as Boolean
Declare this public vairable out side any procedure. (The top line,
before any Sub.. should be above declaration line.)

3. In Procedure1, just before you write to cell, enter following:-
canInow = False
'your code to write to cell
4. After your code to write to cell, you wait for canInow to become
True. The enitre code will look like :-
canInow = False
'your code to write to cell
10
If Not canInow Then
DoEvents
GoTo 10
End If
'your rest of the code.

5. Now in Procedure2, the last line before End Sub Should be:-
canInow = True

Sharad




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!