Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Continouse Calc while userform is shown

Is there anyway to have Excel via VBA do a repetitive calc while a userform
is showing? So when I say:

Userform.Show

I want to mimic what would happen if I held down the F9 key. Now this could
either be based on:

1) a Loop with a timer
2) or it could be continous (triggered after the .show Method) and disabled
when I press a command button on the shown userform.

Any ideas?

Thanks

EM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Continouse Calc while userform is shown

There is no difference between the methods 1 and 2 - you would use method 1
to do method 2, so looks like you are set.

However, if calculation is set to automatic, there is not reason to do
anything else. If a change is made that requires calculation, calculation
will occur. The only reason I could think of to do what you describe is to
either update links or use the worksheet as a clock.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
Is there anyway to have Excel via VBA do a repetitive calc while a

userform
is showing? So when I say:

Userform.Show

I want to mimic what would happen if I held down the F9 key. Now this

could
either be based on:

1) a Loop with a timer
2) or it could be continous (triggered after the .show Method) and

disabled
when I press a command button on the shown userform.

Any ideas?

Thanks

EM



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Continouse Calc while userform is shown

Sorry Tom let me be more specific. I am trying to do something rather goofy.
I have set up a bunch of formulas on a sheet = CHAR(Randbetween(1,250)).
When I calc the sheet, the function generates random characters (like the
beginning of the Matrix Movie). Its really graphic thing. If I hold down
the f9 button, I can generate the affect. However I don't know how to
sustain this while my userfor is shown. My useform is see-through. I want
to display the form and simultaneously have the cells flickerin underneath.
Sounds silly, but I want to do it. I know how to calc within a loop. But
once the loop finishes, the form is shown and the effect is lost. Likewse if
I put the loop after the .Show method of the form, the form shows with no
affect, and then when it closes, the graphic start. I want to see the grapic
while the form is shown.

Thanks

"Tom Ogilvy" wrote:

There is no difference between the methods 1 and 2 - you would use method 1
to do method 2, so looks like you are set.

However, if calculation is set to automatic, there is not reason to do
anything else. If a change is made that requires calculation, calculation
will occur. The only reason I could think of to do what you describe is to
either update links or use the worksheet as a clock.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
Is there anyway to have Excel via VBA do a repetitive calc while a

userform
is showing? So when I say:

Userform.Show

I want to mimic what would happen if I held down the F9 key. Now this

could
either be based on:

1) a Loop with a timer
2) or it could be continous (triggered after the .show Method) and

disabled
when I press a command button on the shown userform.

Any ideas?

Thanks

EM




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Continouse Calc while userform is shown

Put the loop in the activate event of the userform.

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote in message
...
Sorry Tom let me be more specific. I am trying to do something rather

goofy.
I have set up a bunch of formulas on a sheet = CHAR(Randbetween(1,250)).
When I calc the sheet, the function generates random characters (like the
beginning of the Matrix Movie). Its really graphic thing. If I hold

down
the f9 button, I can generate the affect. However I don't know how to
sustain this while my userfor is shown. My useform is see-through. I

want
to display the form and simultaneously have the cells flickerin

underneath.
Sounds silly, but I want to do it. I know how to calc within a loop. But
once the loop finishes, the form is shown and the effect is lost. Likewse

if
I put the loop after the .Show method of the form, the form shows with no
affect, and then when it closes, the graphic start. I want to see the

grapic
while the form is shown.

Thanks

"Tom Ogilvy" wrote:

There is no difference between the methods 1 and 2 - you would use

method 1
to do method 2, so looks like you are set.

However, if calculation is set to automatic, there is not reason to do
anything else. If a change is made that requires calculation,

calculation
will occur. The only reason I could think of to do what you describe is

to
either update links or use the worksheet as a clock.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
Is there anyway to have Excel via VBA do a repetitive calc while a

userform
is showing? So when I say:

Userform.Show

I want to mimic what would happen if I held down the F9 key. Now this

could
either be based on:

1) a Loop with a timer
2) or it could be continous (triggered after the .show Method) and

disabled
when I press a command button on the shown userform.

Any ideas?

Thanks

EM






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Continouse Calc while userform is shown

in the form

Private Sub UserForm_Initialize()
gbCalc = True
doCalc
End Sub

Private Sub UserForm_Terminate()
gbCalc = False
End Sub

in a normal module

Public gbCalc As Boolean

Public Sub doCalc()
Static dtNextCalc As Date
If gbCalc Then
ActiveSheet.Calculate
dtNextCalc = Now + TimeSerial(0, 0, 2)
Application.OnTime dtNextCalc, "doCalc"
ElseIf dtNextCalc Now Then
Application.OnTime dtNextCalc, "doCalc", False
dtNextCalc = 0
End If
End Sub



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


ExcelMonkey wrote :

Sorry Tom let me be more specific. I am trying to do something
rather goofy. I have set up a bunch of formulas on a sheet =
CHAR(Randbetween(1,250)). When I calc the sheet, the function
generates random characters (like the beginning of the Matrix Movie).
Its really graphic thing. If I hold down the f9 button, I can
generate the affect. However I don't know how to sustain this while
my userfor is shown. My useform is see-through. I want to display
the form and simultaneously have the cells flickerin underneath.
Sounds silly, but I want to do it. I know how to calc within a loop.
But once the loop finishes, the form is shown and the effect is lost.
Likewse if I put the loop after the .Show method of the form, the
form shows with no affect, and then when it closes, the graphic
start. I want to see the grapic while the form is shown.

Thanks

"Tom Ogilvy" wrote:

There is no difference between the methods 1 and 2 - you would use
method 1 to do method 2, so looks like you are set.

However, if calculation is set to automatic, there is not reason to
do anything else. If a change is made that requires calculation,
calculation will occur. The only reason I could think of to do
what you describe is to either update links or use the worksheet as
a clock.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in
message ...
Is there anyway to have Excel via VBA do a repetitive calc while a

userform
is showing? So when I say:

Userform.Show

I want to mimic what would happen if I held down the F9 key. Now
this

could
either be based on:

1) a Loop with a timer
2) or it could be continous (triggered after the .show Method) and

disabled
when I press a command button on the shown userform.

Any ideas?

Thanks

EM




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
Convert 29.08 hours (shown in decimal form) to time shown in "hh:m Nila in Florida Excel Worksheet Functions 1 September 14th 08 01:35 AM
Column of Text Shown = Total Times Shown? philcassell Excel Worksheet Functions 3 July 19th 06 07:24 AM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Userform Shown while macro runs ExcelMonkey[_190_] Excel Programming 3 March 15th 05 05:05 PM
Excel: VBA userform is shown but not loaded/initialized even though it was first unloaded? Luisa[_2_] Excel Programming 2 December 5th 03 08:15 AM


All times are GMT +1. The time now is 06:30 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"