Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I change a buttons contents depending on a cells conten

Makes sense...

Many thanks,

Tim
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenate contents of cells whose contents resemble cell referem cathyh Excel Worksheet Functions 3 May 23rd 09 12:16 PM
How can I change a picture depending on a cell's contents LEP Excel Discussion (Misc queries) 1 December 23rd 07 12:16 AM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
Reference range of cells and perform subtraction or nothing depending on contents bob-hamilton Excel Worksheet Functions 3 February 5th 06 04:24 PM
summing up contents on ceratin cells depending on selection criter Charles Excel Worksheet Functions 1 July 21st 05 10:52 PM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"