Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2004, 10:04 PM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with userforms

Whats up everyone I have a simple question. I created a userform (button) that will copy some cells and paste them somewhere. I want the button to be on the sheet rather than having to go to VBA to run or using a macro to bring up the userform. Is there a way to just have the button show on the sheet. If so how can I do this.

Thank you all for your help.

Mike

 
Old June 1st, 2004, 05:15 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

Hi

Im not sure what you mean by you want the button to show on the sheet but if you added the button on the sheet (From Control Toolbox Toolbar) you need to add the code or call the macro/Sub from the onclick event. To enable the button to test the code use the "Exit Design Mode" Button on your Control Toolbox.

If this is not what you looking for you could send me some more detail...

Marnus
 
Old June 1st, 2004, 08:58 AM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I will try to give you as much detail as possible. I would like the button to be embedded in the sheet (in a cell)

The way I have it set up right now. I have to run a macro called Show it:

Sub ShowIt()
    Randomizer.Show
End Sub

Once the macro is ran the userform pops up in the excel sheet. Instead of running this macro I would like the userform directly on the sheet.

I can email you a screenshot if that would help. Thank you


 
Old June 3rd, 2004, 06:33 AM
Authorized User
 
Join Date: Jun 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is as acdsky said,

from the "Control Toolbox" toobar select Command button.

The cursor changes to a small cross, move to area of sheet you wish the buttoon to be, click and hold left mouse button to draw commandbutton.

double click left mouse on command button to bring up code

eg
Private Sub CommandButton1_Click()

End Sub

then type into event what you want the button to do
Private Sub CommandButton1_Click()
Randomizer.Show
End Sub

Finally Select the "Exit Design Mode" button on the control toolbox to enable the command button.

Hope this helps

Martin






Similar Threads
Thread Thread Starter Forum Replies Last Post
close all userforms and pass control back to sub kliu9 Excel VBA 3 February 2nd, 2005 12:51 AM
UserForms "locking up" Joss Excel VBA 1 January 10th, 2004 10:42 PM
userforms in excel 2000 p10rpc Excel VBA 2 November 12th, 2003 01:12 PM
userforms winner13 Excel VBA 0 October 19th, 2003 04:16 PM
Userforms DirtyGerty Excel VBA 0 October 7th, 2003 08:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.