Don,
You could do it with event code that traps a change in cells A1:A4, and
changes the appropriate button accordingly
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A4" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Address(False, False)
Case "A1": Me.Buttons("Button 1").Caption = .Value
Case "A2": Me.Buttons("Button 2").Caption = .Value
Case "A3": Me.Buttons("Button 3").Caption = .Value
Case "A4": Me.Buttons("Button 4").Caption = .Value
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click
This assumes that the buttons are Forms buttons.

Signature
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
> Hi,
>
[quoted text clipped - 11 lines]
>
> DonH
donh - 20 Dec 2006 12:34 GMT
Bob,
I have added your code to the VBA page where my Index is. So far no
luck in getting any further. My buttons were/are VBA Command Buttons
not Form Buttons but have tried creating Form buttons and renaming
those Button 1 etc and then updating cell A1, so far without any
change to the buttons name.
Could you please let me know where I might be going wrong. Also if
possible can this also be done with VBA command buttons. I wanted to
go the VBA route, if it worked, to protect the buttons from accidental
editing or deletion.
Many thanks
Don H
> Don,
>
[quoted text clipped - 51 lines]
> >
> > DonH
donh - 20 Dec 2006 12:49 GMT
Bob,
Forget that. been playing some more and don't think I have done
anything different but that now works thank you. I also recognise my
comment on protection is wrong as I am able to protect the Form button
too.
However :-) if this can be done with VBA Command Buttons I would be
interested as this would help with the colour formatting to group my
index subjects
> Bob,
>
[quoted text clipped - 12 lines]
>
> Don H
Bob Phillips - 20 Dec 2006 12:59 GMT
Here you go Don, control toolbox buttons
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A4" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Address(False, False)
Case "A1": Me.OLEObjects("CommandButton1").Object.Caption =
.Value
Case "A2": Me.OLEObjects("CommandButton2").Object.Caption =
.Value
Case "A3": Me.OLEObjects("CommandButton3").Object.Caption =
.Value
Case "A4": Me.OLEObjects("CommandButton4").Object.Caption =
.Value
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Signature
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
> Bob,
>
[quoted text clipped - 23 lines]
>>
>> Don H
donh - 20 Dec 2006 13:23 GMT
Bob,
Thanks for being so quick. Sorry to say I still have a problem! I
found out what I had done differently to make it work, which is to
update the cell directly.
My worksheet is a works time sheet and has been designed to be used for
the next 10 years. The pattern of work is held in a table (as it
doesn't fall nicely into a monthly cycle).
A year start date is selected from a drop down, from there each period
date is set using a lookup to the work table. It is these period dates
I'm wishing to capture in the buttons. So no cell is actually typed
into. Starts with a drop down and completed by lookups.
Is there a way around this?
Many thanks
Don
> Here you go Don, control toolbox buttons
>
[quoted text clipped - 22 lines]
> Application.EnableEvents = True
> End Sub
Bob Phillips - 20 Dec 2006 15:03 GMT
Don,
Try this approach. It is less efficient as it happens every calculate, but
should work
Private Sub Worksheet_Calculate()
If Not IsError(Me.Range("A1").Value) Then _
If Not IsEmpty(Me.Range("A1").Value) Then _
Me.OLEObjects("CommandButton1").Object.Caption =
Me.Range("A1").Value
If Not IsError(Me.Range("A2").Value) Then _
If Not IsEmpty(Me.Range("A2").Value) Then _
Me.OLEObjects("CommandButton2").Object.Caption =
Me.Range("A2").Value
If Not IsError(Me.Range("A3").Value) Then _
If Not IsEmpty(Me.Range("A3").Value) Then _
Me.OLEObjects("CommandButton3").Object.Caption =
Me.Range("A3").Value
If Not IsError(Me.Range("A4").Value) Then _
If Not IsEmpty(Me.Range("A4").Value) Then _
Me.OLEObjects("CommandButton4").Object.Caption =
Me.Range("A4").Value
End Sub

Signature
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
> Bob,
>
[quoted text clipped - 47 lines]
>> Application.EnableEvents = True
>> End Sub
donh - 20 Dec 2006 15:25 GMT
Bob,
Bit confused, you mention in your post that it is less efficient
because it happens every calculate. Doesn't seem to!
Not that I mind. As this one is a Sub() I can execute I'll just have
an update button to run it when the year is set.
Thank you very much for your time and effort.
Don H
> Don,
>
[quoted text clipped - 21 lines]
>
> End Sub
donh - 20 Dec 2006 15:46 GMT
Bob,
I must confess I talk dribble. In future I shall make an effort to
check what I'm doing before replying to a post. Your suggestion seems
to work fine, haven't a clue why it didn't before.
As for being able to execute it, that at least for me, was dribble too.
If anyone would like to buy me a good book for Christmas, perhaps on
something else I'm more suited to, that would be nice.
I'm off to lie down in a dark room.
DonH
> Bob,
>
[quoted text clipped - 7 lines]
>
> Don H