Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change a buttons contents depending on a cells contents?
I need to change the contents (and format if possible) depending on the
contents of a cell... If possible, the button would only display in certain cells contained data. Is this possible? Thanks, Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change a buttons contents depending on a cells contents?
some thing like this in the Sheet Object where the button is located:
Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Range("C3") = "Hello" Then ActiveSheet.Shapes("MyBtn").Visible = True 'vba seems to require selection before formatting, so: ActiveSheet.Shapes("MyBtn").Select With Selection.Font .FontStyle = "Bold" .Size = 10 .ColorIndex = 3 End With Target.Select Else ActiveSheet.Shapes("MyBtn").Visible = False End If Application.EnableEvents = True End Sub "Kosh42|EFG" wrote: I need to change the contents (and format if possible) depending on the contents of a cell... If possible, the button would only display in certain cells contained data. Is this possible? Thanks, Tim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change a buttons contents depending on a cells conten
Makes sense...
Many thanks, Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
concatenate contents of cells whose contents resemble cell referem | Excel Worksheet Functions | |||
How can I change a picture depending on a cell's contents | Excel Discussion (Misc queries) | |||
compare the contents of one range of cells with the contents of a. | Excel Discussion (Misc queries) | |||
Reference range of cells and perform subtraction or nothing depending on contents | Excel Worksheet Functions | |||
summing up contents on ceratin cells depending on selection criter | Excel Worksheet Functions |