Command Button Visibility

E

Excel_Fan

Hi folks.
I don't know how to make a Command Button visable only betwee
specific dates. This Command Button will contain code to update member
in my Volunteer Fire Department. I am in real need of an answer to thi
issue, even if it can't be done.
Thanks for your help
Keit
 
D

Don Guillett

Hi folks.
I don't know how to make a Command Button visable only between
specific dates. This Command Button will contain code to update members
in my Volunteer Fire Department.  I am in real need of an answer to this
issue, even if it can't be done.
Thanks for your help
Keith

I seldom use commang buttons. Assign your macro to a shape and place
this in the ThisWorkbook module

Private Sub Workbook_Open()
'MsgBox Date
If Date >= DateSerial(2012, 2, 12) And _
Date < DateSerial(2012, 3, 12) Then
ActiveSheet.Shapes("Rectangle 1").Visible = True
Else
ActiveSheet.Shapes("Rectangle 1").Visible = False
End If
End Sub
 
E

Excel_Fan

'Don Guillett[_2_ said:
;1447990']On Feb 20, 5:37*pm, Excel_Fan <k b e r g 9 0 8 4 @ c h a r t
r . n e
t> wrote:-
Hi folks.
I don't know how to make a Command Button visable only between
specific dates. This Command Button will contain code to updat members
in my Volunteer Fire Department. *I am in real need of an answer t this
issue, even if it can't be done.
Thanks for your help
Keith

I seldom use commang buttons. Assign your macro to a shape and place
this in the ThisWorkbook module

Private Sub Workbook_Open()
'MsgBox Date
If Date >= DateSerial(2012, 2, 12) And _
Date < DateSerial(2012, 3, 12) Then
ActiveSheet.Shapes("Rectangle 1").Visible = True
Else
ActiveSheet.Shapes("Rectangle 1").Visible = False
End If
End Sub

Thanks Don,
I believe this will do what I want to do. The only other problem i
that I want this to occur between Jan 1 and Jan 15 each year. I'm no
sure how the code syntax should be entered to accomplish this. (
bought a book on VBA but I have difficulty grasping the formats, synta
and logic)
Thanks again.
K
 
D

Don Guillett

'Don Guillett[_2_ said:
;1447990']On Feb 20, 5:37*pm, Excel_Fan <k b e r g 9 0 8 4 @ c h a r t e
r . n e
t> wrote:-
Hi folks.
I don't know how to make a Command Button visable only between
specific dates. This Command Button will contain code to update members
in my Volunteer Fire Department. *I am in real need of an answer to

Try year(date)
DateSerial(year(date), 1, 1) And
 

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

Top