Macro for pop up

Srushbri1

New Member
Joined
Oct 5, 2017
Messages
5
I am trying to create a button that pops up and gives 4 checkbox options. I would like each of those check marks to run a different macro, when selected.

Can Anyone help?

I want this button, macro called Module3:
1670603276243.png


To popup this called PublishShrinkagePopUp:
1670603246386.png


And then I want each one selected to run a different macro. Each macro can run one after another and combination doesn't impact another so, if "Week1 - O/U" is selected and "Week 2 - Full Shriankge.." is selected then I want it to run the first and fourth macro.

I don't know enough make this execute!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
In module3 put the following code:

VBA Code:
Sub OpenForm()
  UserForm PublishShrinkagePopUp.Show
End Sub

I want this button, macro called Module3:
1670603276243.png
Assign the button to the OpenForm macro.

-----------------------
In the code of the PublishShrinkagePopUp form, put the following:

VBA Code:
Private Sub CommandButton1_Click()
  If CheckBox1 Then Call macro1
  If CheckBox2 Then Call macro2
  If CheckBox3 Then Call macro3
  If CheckBox4 Then Call macro4
End Sub
 
Upvote 0
Thank you! That helped!

Can you tell me what I need to add so that after I click the "Publish Shrinkage" Button the PublishShrinkagePopUp box closes?

Thanks!
 
Upvote 0
In module3 put the following code:

VBA Code:
Sub OpenForm()
  UserForm PublishShrinkagePopUp.Show
End Sub


Assign the button to the OpenForm macro.

-----------------------
In the code of the PublishShrinkagePopUp form, put the following:

VBA Code:
Private Sub CommandButton1_Click()
  If CheckBox1 Then Call macro1
  If CheckBox2 Then Call macro2
  If CheckBox3 Then Call macro3
  If CheckBox4 Then Call macro4
End Sub
Thank you! That helped!

Can you tell me what I need to add so that after I click the "Publish Shrinkage" Button the PublishShrinkagePopUp box closes?

Thanks!
 
Upvote 0
Try Unload Me:

Rich (BB code):
Private Sub CommandButton1_Click()
  If CheckBox1 Then Call macro1
  If CheckBox2 Then Call macro2
  If CheckBox3 Then Call macro3
  If CheckBox4 Then Call macro4
  Unload Me
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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