#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Form


I have set up a user form which has command buttons to open various
worksheets in my workbook. However, I want each worksheet to have a
button to take the user back to the user form; is there a way I could
do this?

Many thanks,
Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default User Form

Sure. All you need for code is
UserForm1.Show
(or whatever the name of your form is)

I would also suggest to you that it might be worth putting a button to do
this on the toolbar (CommandBarButton object): This way one button serves all
sheets, and the buttons will not take up space on your worksheets.
--
- K Dales


"Discovery" wrote:


I have set up a user form which has command buttons to open various
worksheets in my workbook. However, I want each worksheet to have a
button to take the user back to the user form; is there a way I could
do this?

Many thanks,
Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Form


But how can I put the code in the worksheet?

Thanks,
Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Form


But how can I put the code in the worksheet?

Thanks,
Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default User Form

The easy way is to put a commandbutton from the Forms toolbar onto every
sheet where you would like it to function. When it asks you to specify the
macro choose "New..." and you can type the code in the button's _Click
procedure.

The other method, using a single toolbar button, is to insert a module and
add the code in a Public Sub, e.g:
Public Sub ShowMyForm()
UserForm1.Show
End Sub

Then right-click somewhere on your toolbar. Choose "Customize" and in the
dialog go to the tab that says "Commands." If you choose Macros in the
Categories List you will see on the right an option for "Custom Button"
(smiley face). Drag the smiley onto your toolbar, then (with the Customize
dialog still showing) right-click the smiley and choose "Assign Macro..." -
here you should be able to see your ShowMyForm macro in the list, so assign
it to the button. Then whenever the user presses that button the UserForm
should show allowing the selection of another sheet. You can customize this
option even further but this should be enough to at least get you going, I
hope.
--
- K Dales


"Discovery" wrote:


But how can I put the code in the worksheet?

Thanks,
Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Form


Thank you ever so much for your help. I will definately try that out.
I think the first method sounds easiest!

Discovery


--
Discovery
------------------------------------------------------------------------
Discovery's Profile: http://www.excelforum.com/member.php...o&userid=25859
View this thread: http://www.excelforum.com/showthread...hreadid=392433

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User form Mike Rogers New Users to Excel 7 December 16th 05 05:07 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"