How to hide an excel sheet with a macro safely?

0
100

The official Excel is perhaps the best program out there for creating spreadsheets. This is due to the great variety of functions that it brings, and how optimized its interface is. Therefore, no matter what your job is, it will always be good to learn about it. With that in mind today you will see How to hide an Excel sheet with a macro?

How to hide an excel sheet with a macro?

To get straight to the point, you should know that there are many ways to hide Excel sheets, however the easiest and simplest is to use a macro. For that you will need the help of VBA, since with it you will be able to perform this function.

The first thing you have to do to answer the question How to hide an Excel sheet with a macro?, is to go to VBA and insert a module in it. When you’re done, put the following code in it:

Sub hidesheet(), Sheets(“Sheets3”) . Visible = False, End sub. With this code, a button will be given the order to hide the sheet when it is pressed. It should be noted that the command does not go on a single line as you read here, every time you reach the comma you must hit enter (in different lines there would be 3).

graph page

Now that you know what code is going, it’s time to create the action button, for this go to the tab called “Programmer”, then click on the selection called “Insert”, and finally click on the form control called “Button”.

After selecting it, create or draw a button on your sheet by dragging the mouse, that will bring up a dialog window that will allow you to assign a macro, obviously you must choose the one you just created before and that’s it, the button will be configured to hide the blade when pressed.

Another method to hide sheets

With what you have already read the question How to hide an Excel sheet with a macro?, It has already been fully answered, so as a little extra, it is time for you to see another method of hiding a sheet.

To achieve this you have to go to your Excel and open the project to which you will apply the changes. Then stand on the sheet you want to hide, and then go to “Options”, from there to “Tab: programmer and designer”.

In this section you have to press the button that is called “Group: controls”, and finally select “Properties”, that action will make a box pop up with a list of property options where you must choose “Visible”.

graphics page

This selection is the one that will let you hide the sheet, so hover over the dropdown right next to it and choose 2 – xlSheetVeryHidden. With that, the sheet with the changes will be left (you can carry out the same process with all the sheets you want, there is no limit).

And that’s it, with what you saw, your learning today is over, so you can say that you already know the answer to How to hide an Excel sheet with a macro? The next step is to go to your program and start make the changes.

Remember that these processes are very simple, but you must follow all the steps indicated to the letter so that no error will occur (especially when working with the code, since this part is quite delicate). In fact, the act of hiding and showing a formula in Excel is also highly inquired about and few manage to do it by doing it without patience.

Remember this!

Before finishing, once you know everything to hide an Excel sheet with macros, you need to know that these macros are important. Therefore, you must know how to do everything with them: edit a macro in Excel, run a macro automatically, among other things.

Previous articleTest of the Porsche Taycan Sport Turismo Turbo S
Next articleHow to flip or rotate an image in OpenOffice easily