Progress bar in excel, then call another macro

abadilala

New Member
Joined
Sep 29, 2017
Messages
27

<tbody>
[TD="class: votecell"]0down vote favorite
[/TD]
[TD="class: postcell"]I have 2 macro. One for progress bar, and the other one is the main process. The main process consist of 4 sub process inside.
What I want to do is the progress bar increase 25% for each process.
I have created the progress bar macro as below:

<code>Sub code() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+p 'Sub code()

UserForm1.Show

End Sub

Sub progress(pctCompl As Single)

UserForm1.Text.Caption = pctCompl * 25 & "% Completed"

UserForm1.Bar.Width = pctCompl * 50
DoEvents

End Sub

Sub code_real()

Dim i As Integer, j As Integer, pctCompl As Single

Sheet1.Cells.Clear

For i = 1 To 4

For j = 1 To 10000

Cells(i, 1).Value = j

Next j

pctCompl = i

progress pctCompl

Next i

End Sub

</code>
My question is, how can I call main process macro while the macro for progress bar is running? I heard only 1 macro can be run at a time.

[/TD]

</tbody>
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top