ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dave Peterson/JLatham Command Button (https://www.excelbanter.com/excel-discussion-misc-queries/214068-dave-peterson-jlatham-re-command-button.html)

aussiegirlone

Dave Peterson/JLatham Command Button
 
The Question I wrote:
I have a command button that when clicked it goes to another sheet
And it works beautifully thanks to other members, I named this button
Sunday. now I wish this same buttons name to change automatically when I
change a date on a different worksheet. Is this possible?
I'm so excited! Your code worked
Thankyou
Aussiegirlone

Bob Phillips[_3_]

Dave Peterson/JLatham Command Button
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1" '<=== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then

Worksheets("Sheet1").Buttons("myButton").Caption = Target.Value
End If
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 on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
__________________________________
HTH

Bob

"aussiegirlone" wrote in message
...
The Question I wrote:
I have a command button that when clicked it goes to another sheet
And it works beautifully thanks to other members, I named this button
Sunday. now I wish this same buttons name to change automatically when I
change a date on a different worksheet. Is this possible?
I'm so excited! Your code worked
Thankyou
Aussiegirlone





All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com