Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button Caption
I have a comand button on sheet1. I'd like the caption on the button to
change depending on what is listed in cell a1 on sheet2. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button Caption
Use the calculate event for sheet2 if the value will change due to a formula
Right click on the sheet tab and select view code. Then in the resulting module put in code similar to this. Private Sub Calculate() worksheets("Sheet1").CommandButton1.Caption = _ Me.Range("A1").Value End Sub If the cell must be manually edited to change then use the Change Event Private Sub Worksheet_Change(ByVal Target As Range) worksheets("Sheet1").CommandButton1.Caption = _ Me.Range("A1").Value End Sub Chip Pearson's page on events if not familiar with them http://www.cpearson.com/excel/events.htm -- Regards, Tom Ogilvy "Qaspec" wrote in message ... I have a comand button on sheet1. I'd like the caption on the button to change depending on what is listed in cell a1 on sheet2. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change caption of a button | Excel Worksheet Functions | |||
Change Caption of Forms Command Button | Excel Programming | |||
Option button caption | Excel Programming | |||
Caption of a button | Excel Programming | |||
Urgent: VBA Command Button Caption Problem | Excel Programming |