Hi Nigel
I am trying to change the display text on the Commandbutton1 to read TEXT in
cell reference sheet1!B2
Is this possible?
I have several command buttons on this one sheet, each taking the user to a
designated sheet, namely class 1, class 2 etc. The idea is a teacher can see
at a glance which class is which.
You may wonder why I haven't simply changed the sheet tap names, and I tried
this originally, however, on a couple of the sheets I wanted to look up
values in other sheets and created a vlookup. This required labelling each
sheet and wouldn't allow me to then change the tabs, hence command button
approach. Also, I thought this might be more user friendly as there are 10
classes in each workbook.
Regards
Tanya
"Nigel" wrote:
Unless you are referring to a Form Control, a control button has a property
called Caption, that is the name that appears on the button, not its's name
which is used by Excel and VBA code to identifiy it.
SO to change the caption, use
CommandButton1.Caption = "My Button"
To link this to a cell, you could use
CommandButton1.Caption = Range("A1")
To run the above manually store it in the code sheet for the worksheet where
the control is placed.
If you want it to automatically change it when the cell is changed, use the
change event, something like
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
CommandButton1.Caption = Range("A1").Value
End If
End Sub
--
Regards,
Nigel
"Tanya" wrote in message
...
Hi
Is it possible to have the description/label of a command button updated
by
the title in a sheet cell?
cheers
Tanya