rrosa1
05-12-2010, 01:43 PM
hi
can i hide the command button in sheet for 9am to next day 8am so in anther ward command button visible for 8am to 9am every morning .
i try some code from the forum but it not working.
i am new to VB so pl help me to code the same
it 's highly appreciated any help
here i am attaching my test wb.
Private Sub CommandButton4_Click()
'Sub findTime()and hide the botton
Dim dHoursMinutes As Double
Dim c As Range
Dim lRow As Long
Dim Button_Name As String
Button_Name = "CommandButton4"
With ActiveSheet.Buttons(Button_Name)
Set c = Now()
dHoursMinutes = Val(Hour(c)) & "." & Minute(c)
If dHoursMinutes >= 8.3 And dHoursMinutes <= 9.3 Then
.Visible = True
Else
.Visble = False
End If
End With
End Sub
can i hide the command button in sheet for 9am to next day 8am so in anther ward command button visible for 8am to 9am every morning .
i try some code from the forum but it not working.
i am new to VB so pl help me to code the same
it 's highly appreciated any help
here i am attaching my test wb.
Private Sub CommandButton4_Click()
'Sub findTime()and hide the botton
Dim dHoursMinutes As Double
Dim c As Range
Dim lRow As Long
Dim Button_Name As String
Button_Name = "CommandButton4"
With ActiveSheet.Buttons(Button_Name)
Set c = Now()
dHoursMinutes = Val(Hour(c)) & "." & Minute(c)
If dHoursMinutes >= 8.3 And dHoursMinutes <= 9.3 Then
.Visible = True
Else
.Visble = False
End If
End With
End Sub