LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Button Selection OnAction property

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
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
Passing several parameters to OnAction property. LABKHAND Excel Discussion (Misc queries) 1 April 24th 09 08:02 PM
DrawingObjects/AutoShapes' .OnAction property in DialogSheets BizMark Excel Discussion (Misc queries) 0 October 12th 05 12:40 PM
Propblem setting OnAction property at runtime Philip Excel Programming 2 January 26th 04 05:51 PM
unable to set the OnAction Property of the Text Box Russell Harris Excel Programming 1 December 10th 03 12:52 AM
Find OnAction property Kemosabe Excel Programming 1 November 21st 03 03:34 PM


All times are GMT +1. The time now is 08:45 AM.

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

About Us

"It's about Microsoft Excel"