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.
 
I believe so. I would start the recorder, then perform how I would unhide the sheet. I think thats right??
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
yes, ok, open your first sheet, then start the recorder and give a name to your macro. Then click ok, and a small box saying stop will appear. disregard that box for now. go thru all the steps to open your hidden sheet. when it is open, then click on the stop button. then close the hidden sheet to get back to your initial sheet and save it. Then get back to me.
 
Upvote 0
OK, I got the macro recorder and the sheet saved. I assumed when you said to close the second sheet, you meant for me to re-hide it?
 
Upvote 0
Hi Jerminator

If you follow the suggestion of recording a macro i.e. you go to Format, select Sheet and click on Unhide it will show you all the hidden sheets. In this example I clicked sheet5 and ended the macro recorder. This is what you get.

Sub Showit()
'

Sheets("Sheet5").Visible = True
End Sub

You indicate that you do not want the user to input any data. Therefore using the above method you would need a button for each sheet. Are you looking for a way to select a sheet from a list and unhide it?
 
Upvote 0
I have the button built on the first sheet.

JAK, Would I ultimately am looking for is for the user to click button and a popup type window opens with a hidden sheet in its contents. Don't know if this is possible. Maybe, but might require a bit of programming. If you have any idea, I would greatly appreciate it!
 
Upvote 0
If the button is made, right click on it and assign it to the macor that we just made. then when the user clicks this button, that sheet will open
 
Upvote 0
It really doesn't matter, I am just happy that I am getting some help. I have been reading books and books and websites trying to figure out how to accomplish what I am trying to do. I will owe you both if we can make this happen.
 
Upvote 0
Hi Elgringo56

Sorry for jumping in both feet first, I did not read all the posts. I now see what you were doing. I will stand in the corner for 10 minutes ;P)

Hi Jerminator

I will play around with some ideas and get back to you with some instructions.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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