ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Command Button Visibility (https://www.excelbanter.com/excel-discussion-misc-queries/406324-command-button-visibility.html)

Excel_Fan

Command Button Visibility
 
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

Don Guillett[_2_]

Command Button Visibility
 
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 this
issue, even if it can't be done.
Thanks for your help
Keith

--
Excel_Fan


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





Excel_Fan

Quote:

Originally Posted by Don Guillett[_2_] (Post 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 this
issue, even if it can't be done.
Thanks for your help
Keith

--
Excel_Fan


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 is that I want this to occur between Jan 1 and Jan 15 each year. I'm not sure how the code syntax should be entered to accomplish this. (I bought a book on VBA but I have difficulty grasping the formats, syntax and logic)
Thanks again.
KB

Don Guillett[_2_]

Command Button Visibility
 
On Thursday, March 1, 2012 11:07:18 PM UTC-6, Excel_Fan wrote:
'Don Guillett[_2_ Wrote:
;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

this
issue, even if it can't be done.
Thanks for your help
Keith

--
Excel_Fan-


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 is
that I want this to occur between Jan 1 and Jan 15 each year. I'm not
sure how the code syntax should be entered to accomplish this. (I
bought a book on VBA but I have difficulty grasping the formats, syntax
and logic)
Thanks again.
KB




--
Excel_Fan



All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com