View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sean Sean is offline
external usenet poster
 
Posts: 454
Default Progress Bar Macro Incorporated Into MyMacro

On Oct 11, 9:31 pm, ryguy7272
wrote:
I am trying to get the Progress Bar macro incorporated into a macro that I
use to create and format a report for work. I am not sure where to put the
code for the macro that I developed because it seems like

The Progress Bar macro is hehttp://support.microsoft.com/kb/211736

I though I could place my code into the area after "Call Main"
Private Sub UserForm_Activate()
' Set the width of the progress bar to 0.
UserForm1.LabelProgress.Width = 0

' Call the main subroutine.
Call Main
Call MyMacro
End Sub

But it doesn't seem like I can split the time between the Progress Bar and
my own macro (MyMacro). One sub runs and the other runs (based on whether I
arrange the code order as Call Main and then Call MyMacro or Call MyMacro and
thenCall Main). Also, how would I get the Progress Bar to progress based on
the time duration of MyMacro (this changes)?

Right now I use a timer and a MessageBox:
Sub MyMacro
Dim sngStart As Double
sngStart = Now
'code here
'...etc
MsgBox "Process Complete!! " & Counter & _
" File Updated" & vbNewLine & _
" took " & Format(Now - sngStart, "hh:mm:ss")
End Sub

Regards,
Ryan---

--
RyGuy


I got this working pretty well, I'll see if I can get a sample piece
of code.