|
-
Mar 7th, 2006, 03:42 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Button to Excel Worksheet VBA
I've got a form that auto loads when my spreadsheet opens. The problem is that this form can be closed or x-ed out, and the only way for it to return is to close and reopen the spreadsheet.
Is there any way that I can add a button to my spreadsheet which would reopen this form?
Thanks!
I'm a complete n00b so i apologize if this is Excel VBA 101 stuff.
-
Mar 7th, 2006, 03:47 PM
#2
Re: Button to Excel Worksheet VBA
Sure
Add a command button and in its click event you cal create and display an instance of the form.
You will need to change 'UserForm1' to the name of your form.
VB Code:
Private Sub CommandButton1_Click()
Dim frmStartUpForm As UserForm1
Set frmStartUpForm = New UserForm1
frmStartUpForm.Show
'etc
'etc
Set frmStartUpForm = Nothing
End Sub
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 7th, 2006, 04:10 PM
#3
Thread Starter
Fanatic Member
Re: Button to Excel Worksheet VBA
thanks... i'm looking through excel, and I can't seem to find the option to add a command button to my worksheet...
am I missing something?
-
Mar 7th, 2006, 04:11 PM
#4
Re: Button to Excel Worksheet VBA
-->View-->Toolbars-->Control Toolbox
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 7th, 2006, 04:13 PM
#5
Addicted Member
Re: Button to Excel Worksheet VBA
Right click on the toolbar and check the control toolbox option
then you're gonna have all you need to design including button
-
Mar 7th, 2006, 04:14 PM
#6
Addicted Member
Re: Button to Excel Worksheet VBA
too slow on the trigger
-
Mar 7th, 2006, 04:31 PM
#7
Thread Starter
Fanatic Member
Re: Button to Excel Worksheet VBA
yah... i was just being a moron... i figured it out.... :-\ thanks for supporting my lack of brain function :-D
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|