How to set Macro1 invisible to the user?

navic

Active Member
Joined
Jun 14, 2015
Messages
346
Office Version
  1. 2013
Platform
  1. Windows
I have an ActiveX button on the Index worksheet. By clicking on this button i want to call two VBA macros

In Module1 exists
Macro1 = Import multiple specific sheets from all files in folder
Macro2 = List all sheets on Helper sheet in active wokrbook

However, I do not want the user to see these two macros, in the 'Macros' window on the 'Developer' menu tab.
If I set "Private" then the button does not work.

How to run two "Private" VBA macros with one button if the macros are located in Module1. Is that possible?
This is the VBA macro located in the sheet module (Index)
Code:
Private Sub CommandButton1_Click()
    ActiveSheet.CommandButton1.BackColor = &HFF&
    Call Macro1
    Call Macro2
End Sub
can somebody help?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
You can call them like
Code:
Application.Run "Module1.macro1"
 
Upvote 0
Solution
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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