Thread: Commandbuttons
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Melanie Breden Melanie Breden is offline
external usenet poster
 
Posts: 88
Default Commandbuttons

PCOR wrote:
I have a sheet with 2 commandbuttons on it.
I want button1 to be visible if the total just above it is over 2500. Should
the total be below that level, I would like button 1 to be invisible and
button 2 to be visible
Can it be done,
How?


insert the following procedure into the code module of the sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) < "F10" Then Exit Sub
CommandButton1.Visible = Target.Value 2500
CommandButton2.Visible = Target.Value <= 2500
End Sub

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)