How to Hide Macros in an Excel Workbook

Microsoft Excel includes options for creating macros that repeat tasks at the touch of a button so you don't have to manually perform the same operations repeatedly. If your workbook is used by many different people, you may not want the macro to be readily available to everyone. To improve security and ensure macros aren't abused, Excel 2010 allows you to hide macros from other users by changing a single line of code in the Visual Basic for Applications (VBA) editor.

Instructions

    • 1

      Open Microsoft Excel and navigate to the "Menus" tab at the top, left corner of the screen. Click the "Files" drop-down menu and select "Open." Double-click the name of the Excel workbook that has the macro you want to hide.

    • 2

      Navigate to the "Developer" tab, which is located at the top, right corner of the window. Click the "Macros" button, which is positioned at the left side of the navigation ribbon and to the right of the "Visual Basic" button.

    • 3

      Scroll through the list of macros and locate the name of the macro you want to hide. Click "Cancel" to close the window and click the "Visual Basic" button to open the VBA editor window.

    • 4

      Click the "Modules" link at the left side of the window to bring up a list of VBA modules saved on the workbook. Scroll through the code until you find the opening "Sub" command at the top of the Macro. For instance, if the Macro is titled "Macro1," the line of code should read "Sub Macro1()."

    • 5

      Click behind the opening "Sub" command and type the word "Private." Add a space between the "Private" and "Sub" commands so your line of code reads "Private Sub Macro1()."

    • 6

      Click "File" and choose "Save" to save the changes and hide your macro.

Tips & Warnings

  • Depending on your settings, the "Developer" tab may not appear in the navigation ribbon at the top of the screen. If you don't see the tab, navigate to the "File" tab and click "Options." Navigate to "Customize Ribbon" and click the "Developer" check box. Click "OK" to close the window and place the "Developer" tab in the ribbon.
  • If you no longer need the macro to be hidden, return to the VBA editor window and simply delete the "Private" command from the line of code.
Related Searches

References

Resources

  • Photo Credit Photos.com/Photos.com/Getty Images

You May Also Like

  • How to Use VBA to Hide Columns

    The Visual Basic for Applications (VBA) editor included in Microsoft Excel allows users to create custom code for manipulating spreadsheets. VBA lets...

  • How to Create a Macro in Excel 2010

    Advanced users of Microsoft Excel 2010 often use macros to speed their ability to perform computing tasks. A macro is a series...

Related Ads

Watch Video

The 2014 Holiday Gadget Roundup