Commandbuttons

  • Thread starter Thread starter PCOR
  • Start date Start date
P

PCOR

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?
Thanks
 
PCOR said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top