Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created some custom views in my excel document. Normally I use view>custom views>select view method to activate related view. Is it possible to make this job by adding control buttons on excel sheet?

For example there will be a button for each custom view and when I click the button it will show me related view.

share|improve this question
up vote 3 down vote accepted

You can do this by enabling the Developer tab in Excel Options, selecting Design Mode, and inserting a Button form control.

When you insert the button control, Excel should open the macro dialog with a macro name like Button1_Click. When you see that, click New on the macro dialog. This will open the event handler for the Button#_Click event in the Visual Basic editor. You'll need to add a line of code to the event handler, so that it looks like this...

Sub Button1_Click()
    ' this is a comment...
End Sub

Replace CustomViewName with the actual name of the view you want to show. When you leave design mode and click the button, it should show your custom view. Just add a button and repeat for each view.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .