Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a function that I often call from within my code to take me to a particular sheet. Public Function Go_To(address As String) Sheets(address).Select Range("A1").Select End Function I now want to create a button that will call this function, and am at a loss as to how to do this. Can anyone help? Is it possible to do this? Here is my code for the button Sub Button ActiveSheet.Buttons.Add(350, 0, 72, 72).Select Selection.Name = "Go_To_Index" Selection.OnAction = "Call Go_To(""Sheet 1"")" '<-----------Here is my problem ActiveSheet.Shapes("Go_To_Index").Select Selection.Characters.Text = "Go To Index" With Selection.Characters(Start:=1, Length:=18).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .ReadingOrder = xlContext .Orientation = xlHorizontal .AutoSize = True End With End Sub Many Thanks - Grant |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing several parameters to OnAction property. | Excel Discussion (Misc queries) | |||
DrawingObjects/AutoShapes' .OnAction property in DialogSheets | Excel Discussion (Misc queries) | |||
Propblem setting OnAction property at runtime | Excel Programming | |||
unable to set the OnAction Property of the Text Box | Excel Programming | |||
Find OnAction property | Excel Programming |