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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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