• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

Any Excel masters around that can help me?

Would you mind explaining how you created that button? Or do you know what it is called so I can look it up in the Excel help menu and see how to create one?

Use the Forms toolbar. Click the new button icon, and place on the worksheet. You'll be prompted for a macro when the button is placed. You can right click on the button to change its properties.

I'd like to make what you have, except have it hide certain rows & columns. For example, hide rows A1-A50 along with B1-B50.

Sure, you can do pretty much anything with a macro. So long as you tie that macro to the button, it will do what you need.

Also, is it possible to have 1 button perform both the hide & reveal action rather than having 1 button for each action? Click it once to reveal, click it again to hide.

My thinking is that you'd need to add a couple IF statements to the macro. For example, if cell C1 is hidden, it runs the code to reveal, if C1 is not hidden, it runs the code to hide. The problem is that I can't find an Excel VBA command that will return whether or not a cell is hidden. I could do this on an MS Access form, so maybe someone else knows a way to find this property in Excel.
 

log in or register to remove this ad

If you are using Excel 2007, you can create custom views and then make a macro to switch between them.

Go to the View tab and click Custom Views. Click Add and name the first one Standard or something. Then hide all the rows and columns you want, adjust zoom, and whatever you want. Click on Custom View and add that one with a new name. Keep doing that until you have all your possible views. Then record a macro switching between each one. You'll probably have to have a separate button for each view though.

Custom Views have been around for longer than Excel 2007. I first used them in Excel 2000, and there is a chance they were there in previous versions as well.

As to macros for viewing custom views, you will need a separate macro for each view. This is something I show when showing Macros in a training course.
 

My thinking is that you'd need to add a couple IF statements to the macro. For example, if cell C1 is hidden, it runs the code to reveal, if C1 is not hidden, it runs the code to hide. The problem is that I can't find an Excel VBA command that will return whether or not a cell is hidden. I could do this on an MS Access form, so maybe someone else knows a way to find this property in Excel.

Actually there is a chance that only one button is required to turn on/off the grouping.

You can create a macro to turn on AutoFilter and when you keep clicking on it, it turns the filter on,then off, once more on and so on. So there is a chance that only the one macro and button is required.
 

Actually there is a chance that only one button is required to turn on/off the grouping.

You can create a macro to turn on AutoFilter and when you keep clicking on it, it turns the filter on,then off, once more on and so on. So there is a chance that only the one macro and button is required.

Is there any chance you can explain to me how to accomplish this in excel? Or could someone make it for me and send me the file and then explain to me how I can edit my own info into the sheet? I'm somewhat familiar with excel but it may need to be explained in some detail so I can create it :o
 

Into the Woods

Remove ads

Top