PC Review


Reply
Thread Tools Rate Thread

On calculate question

 
 
Chad
Guest
Posts: n/a
 
      23rd Dec 2009
Public Sub Impact2()
If MsgBox("Would you like to record the changes that were just made?",
vbYesNo, "Record Changes?") = vbNo Then
Exit Sub
End If

End Sub

 
Reply With Quote
 
 
 
 
Chad
Guest
Posts: n/a
 
      23rd Dec 2009
Sorry, here is my question:

In the "This Workbook" object I have a subroutine as follows:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Call Impact2
End Sub

The subroutine Impact2 can be found below:

Public Sub Impact2()
If MsgBox("Would you like to record the changes that were just made?",
vbYesNo, "Record Changes?") = vbNo Then
Exit Sub
End If
End Sub



My problem is that when I calculate, Impact2 is run 10 times and I have to
select 'No' every time before the code finishes running. Is the workbook
calculating more than once? (I have number of iterations set to 0). What can
I do to fix this?

Thanks for your help,
Chad


"Chad" wrote:

> Public Sub Impact2()
> If MsgBox("Would you like to record the changes that were just made?",
> vbYesNo, "Record Changes?") = vbNo Then
> Exit Sub
> End If
>
> End Sub
>

 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      23rd Dec 2009
OK, after playing around with it for a little bit here are a few other items
that might help im the prognosis:

I changed the code in the workbook_sheetcalculate subroutine to:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
MsgBox "test"
End Sub

Whenever I run the code from the code viewer, it runs ok, but whenever it is
run by calculating, this procedure is run 12 times.

If anyone could help I would be very greatful.

Thanks again,
Chad
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Calculate Question / HELP! Andy Microsoft Excel Worksheet Functions 2 7th Jan 2010 06:21 PM
On Calculate question Chad Microsoft Excel Worksheet Functions 0 23rd Dec 2009 09:40 PM
Worksheet calculate -question kativa Microsoft Excel Programming 1 8th Dec 2008 09:11 AM
Accuracy of Using Calculate - IMPORTANT QUESTION PLEASE Paige Microsoft Excel Programming 2 7th May 2008 06:21 PM
Auto Calculate Question =?Utf-8?B?Q2hhZA==?= Microsoft Excel Programming 3 20th Feb 2007 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.