Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default command button

Need Hellllllp!!

I'm a novice excell user and would like to create one command button to run
various functions in 4 different cells. In other words I would like to type
in the values in the 4 cells then hit my command button to run the various
functions that follow..... I have created the button in my wrk sheet but I
have never used visual basic before and use some help...been at it all night
and gotten no where.

Anything will be a great deal of help


Nate...El Paso tx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default command button

Hi Nate

Not really sure what you are asking here, do you have your functions
already written? if so you can place them in a module and call them
when you click the button. to do this you will need to open the
visual basic editor from under the Macro option of the Tools -menu or
ALT + F11.

From here Insert a module and put code in it to call your functions

and then assign that sub to your button then when you click the button
it will run your functions, to do that right click on your button
while in Design Mode and select the assign Macro option. this loads
the Asign Macro window where you shoul dbe able to see the name of
your Sub in the list select it and click OK and thats it. i have
given a code example below

Option Explicit

Sub RunMyFunctions()

'replace the MyFunction title with the name of the function
'you want to run i.e. your function is called ResizeRange
'you would write Call ResizeRange

Call MyFunction
Call MyFunction1
Call MyFunction2
Call MyFunction3

End Sub

Function MyFunction()
MsgBox "First Function"
End Function
Function MyFunction1()
MsgBox "Second Function"
End Function
Function MyFunction2()
MsgBox "Third Function"
End Function
Function MyFunction3()
MsgBox "Fourth Function"
End Function

hope this helps

Steve

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
Wanting to Create A Command Button Command bumper338 Excel Programming 3 May 7th 07 06:53 PM
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Command Button vs Form Button Bri[_3_] Excel Programming 2 February 3rd 06 08:18 AM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


All times are GMT +1. The time now is 11:59 PM.

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

About Us

"It's about Microsoft Excel"