Value from Cell Onto Command Button

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
205
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 calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,215,494
Messages
6,125,139
Members
449,207
Latest member
VictorSiwiide

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