Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading the button text for excel 2003 1

Status
Not open for further replies.

jaeyoo

Technical User
Dec 14, 2005
8
US
Hi,

I'm trying to make my macro read the button text to go to the sheet name that's on the button and for excel 2000

text = ActiveSheet.Button(Application.Caller).Characters.Text

this used to work but for excel 2003 this doesn't work anymore. please help what changes do i have to make for it to work on excel 2003?
 



Hi,

How about the Caption property of the button control?

Skip,

[glasses] [red][/red]
[tongue]
 

Code:
Sub MyButton_Click()
   sText = MyButton.Caption
End Sub
If your button is on a Sheet object, then you are ALREADY on the Sheet.

If your button is on a UserForm, then how do you know what sheet to go to?

Skip,

[glasses] [red][/red]
[tongue]
 
Didn't work....

Sub MyButton_Click()

Dim sText As String
Dim x As Integer

x = 0
sText = MyButton.Caption
End Sub
 


Do you have a button named MyButton?

It's gotta be in the CLICK event for an existing button.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top