Thread: command button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Incidental Incidental is offline
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