View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Command Button Invisible

I have a spreadsheet of names that need to be sorted ONLY between the
dates of January 1 and January 15 each year. I have a command button
with a macro to do that and it works fine. I want the Command Button
to become invisible (and also disabled) for the remainder of the
year, then become visible and enabled January 1 the next year. Is
this possible?


Yes/Yes if it's an ActiveX button from the Controls Toolbox. Yes/No if
it's a button from the Forms controls as these don't have an Enabled
property...

With ActiveSheet.CommandButton1
.Visible = False: .Enabled = False
End With 'ActiveSheet.CommandButton1

...though if you hide it I don't see why you need to disable it!

ActiveSheet.Shapes("Button 1").Visible = False

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion