Showing another worksheet from a form

  • Thread starter Thread starter Rhema
  • Start date Start date
R

Rhema

I have created a form. I want to be able to click on a command butto
and show another worksheet (ie.graph). When finished viewing I want t
click on a close command button and return to the form.
Is this possible in Excel.

Thanks in anticipation.

Regards

Rhem
 
Rhema,

There may be a slicker way, but you can to this. In the form, the button
runs this (put in UserForm module):

Private Sub CommandButton1_Click()
UserForm1.Hide ' dismiss the form
Sheets("Chart1").Visible = True ' optional
Sheets("Chart1").Select
ActiveWindow.DisplayWorkbookTabs = False ' keep user here
End Sub

It temporarily hides the worksheet tabs (optional) A close button on the
chart sheet runs this code (regular module). Put a button on it, and assign
it to the following macro :


Sub Chart1Return()
Sheets("Sheet1").Select ' reselect original sheet (1)
Sheets("Chart1").Visible = False ' optional (if chart was hidden)
ActiveWindow.DisplayWorkbookTabs = True
UserForm1.Show
End Sub

(1) If the Userform will be called from more than one possible sheet, the
code can store the sheet from where it was called, and this proc can return
to that sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top