Value from Cell Onto Command Button

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
203
Is it Possibel to get Value from Cell onto Commanbutton
So the Text on Commandbutton change if the text Change in a Specific Cell example If value in "D1" is " Player 1" then The Text on Command Button Also is "Player 1"

what i self have done so far was Searching around Google and Didn realy find what i was looking for
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Then I have no idea why it isn't working for you. It's working for me. What version of Excel are you using? Do you have macros enabled in Excel?
 
Upvote 0
The coding is very basic so it actually should work for any version of Excel. Do you have macros enabled in Excel?
 
Upvote 0
Place this version in the worksheet code module for the "Cup 8 2nd Chance (2)" sheet.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Address(0, 0) <> "D1" Then Exit Sub
    ActiveSheet.Shapes.Range(Array("Button 2")).Select
    Selection.Caption = Target
End Sub
 
Upvote 0
Try this version in the worksheet code module for the "Cup 8 2nd Chance (2)" sheet. If you see a message pop up when you change D1, the macro is working. If no message pops up, there is something else that is preventing it from executing.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Address(0, 0) <> "D1" Then Exit Sub
    MsgBox ("If you see this message, the macro is executing.")
    ActiveSheet.Shapes.Range(Array("Button 2")).Select
    Selection.Caption = Target
End Sub
 
Upvote 1
THANK YOU FOR THE HELP! WHAT AND WHEN AND HOW I DONT KNOW But i works Now
only thing i did was Restart my Laptop.....

and put your Code with Msgbox as new Future....
i have make a Opostrof so the line with Msgbox wont Appear evertime
Thanks alot again

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Address(0, 0) <> "D1" Then Exit Sub
' MsgBox ("If you see this message, the macro is executing.")
ActiveSheet.Shapes.Range(Array("Button 2")).Select
Selection.Caption = Target
End Sub
 
Upvote 0
You are very welcome. :) Make sure you delete the macro in the standard code module if it still there.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top