View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How do I make a command button invisible or visible?

Private Sub cmdHide_Click()
With Me
.cmdHide.Visible = False
.cmdUnhide.Visible = True
.cmdDo1.Visible = False
End With
End Sub


Private Sub cmdUnhide_Click()
With Me
.cmdHide.Visible = True
.cmdUnhide.Visible = False
.cmdDo1.Visible = True
End With
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mandora" wrote in message
...
I have two command buttons. One hides a range of columns with VB code. One
unhides the same range with VB code. Due to space constraints I would like

to
have the 'hide" button set the visible property of that button to false

and
the "hide button" to true and visa-versa with the other button. By placing
the buttons on top of each other the proper button is always visible and
space used is compact. I am new to VB and can't get this to work although

I
assume it is possible. Suggestions?