Programming Buttons in Excel

Jerminator

New Member
Joined
Aug 8, 2002
Messages
33
Just getting started with VB and VBA. I do a lot of Workbooks monthly for my customers that I import a .csv and I try to have it automated as much as possible. What I would like to do is add buttons to my first worksheet and hide the remainder sheets. Which I have accomplished. The problem I am having is programming the buttons on click to open a particular hidden sheet in the workbook. Is this possible and does anyone know what the command for this would be? I would greatly appreciate it.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Not totally sure what you are asking, but you can write a macro and assign it to the button so that it will open the workbook you want. you can use the macro recorder for this to write the macro, then when you have it as you want it, assign that macro to a particular button
 
Upvote 0
Sheets("Sheet1").Visible = True

will unhide the sheet

Sheets("Sheet1").Visible = False

will hide the sheet

Sheets("Sheet1").Visible = xlVeryHidden

will hide it so the user cannot see it at all to "unhide" it.
 
Upvote 0
Sorry, I guess what I am asking is, I have a workbook with 5 sheets built. They are all hidden but the first sheet. On the first sheet I would like to place a button and have that programmed to open a particular hidden worksheet within that workbook. I have looked everywhere for a command to use in VBA but have yet to find anything.
 
Upvote 0
I'm apologize for not being able to explain this clearly. Sometimes I want to perform things that get to complex. Here is a better description. What I am really trying to accomplish, is when the button is clicked by a user, I would like a seperate window per say to open with the hidden sheet in int's contents, then I would have a button within that sheet to close out that window. Don't know if this is possible or not. I was thinking along the lines of a dialog box, but not sure that would be appropriate as I wouldn't be asking for any input. Hope this helps, and I do appreciate your help. :)
 
Upvote 0
Ok, if you were doing this manually, how would you open the hidden sheet, that is what i want to know, then I will show you how to use the macro recorder to do it, and then assign it to a button.
 
Upvote 0
I would normally go to Menu/Format/Unhide, then select the hidden worksheet I would want unhidden. But is there a way to have that sheet open on top of the workbook in a seperate window, that could be closed out after viewing? Thanks :)
 
Upvote 0

Forum statistics

Threads
1,214,400
Messages
6,119,292
Members
448,885
Latest member
LokiSonic

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