ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Progress Bar Macro Incorporated Into MyMacro (https://www.excelbanter.com/excel-programming/399185-progress-bar-macro-incorporated-into-mymacro.html)

ryguy7272

Progress Bar Macro Incorporated Into MyMacro
 
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 he
http://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 doesnt 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

Sean

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.


Sean

Progress Bar Macro Incorporated Into MyMacro
 
On Oct 11, 9:42 pm, Sean wrote:
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.- Hide quoted text -

- Show quoted text -


I have a sample fle which I got on this board, you can see the code
behind it and a working example, if you want it just e-mail me. You
should be able to export the form and the class module from this file,
author of this example is Robin Hammond, perhaps just do a search on
this name and you may find it also


FSt1

Progress Bar Macro Incorporated Into MyMacro
 
hi
i think you need to go back a read the article again. you are suppose to
create a userform to display the status bar, put the code in the user form
then call the user form to run the status bar.
while your at it. check this out as an alternative
http://support.microsoft.com/default...;EN-US;Q103404
how to use the status bar.

Regards
FSt1

"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 he
http://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 doesnt 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


FSt1

Progress Bar Macro Incorporated Into MyMacro
 
oh yes...note this too.
the code you are looking at on the web site(main) is do nothing code that
only generates random numbers and the progress meter measures it's progress.
you need to replace that part of the progress meter code (the loop part)
with your code so that the progress meter is measuring what you are doing. in
other words, build your code inside the progress meter code.

regards
FSt1


"FSt1" wrote:

hi
i think you need to go back a read the article again. you are suppose to
create a userform to display the status bar, put the code in the user form
then call the user form to run the status bar.
while your at it. check this out as an alternative
http://support.microsoft.com/default...;EN-US;Q103404
how to use the status bar.

Regards
FSt1

"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 he
http://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 doesnt 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


Tim879

Progress Bar Macro Incorporated Into MyMacro
 
Based on the comment above from Sean...

The website he was referring to is http://www.enhanceddatasystems.com/E...rogressBar.htm

I downloaded the files yesterday and I must admit, they worked like a
charm and were extremely easy to use.


On Oct 11, 4: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





All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com