Hi,
With the help of others' posts I've managed to insert a pop-up date & time picker (Calendar1) that gets activated whenever I select a cell within specific columns (Case Target.Column).
My problem now is that whenever I am working with any other cell not within my Target.Column I would like the Calendar1 not to show any more.
I'm not knowledgeable at all when it comes to VBA language, so I've tried different approaches with no success whatsoever. I assumed that the line If Calendar1.Visible Then Calendar1.Visible = False would do the trick but as far as I can tell, it has no relevance for this macro.
Any piece of advise is greatly appreciated.
With the help of others' posts I've managed to insert a pop-up date & time picker (Calendar1) that gets activated whenever I select a cell within specific columns (Case Target.Column).
My problem now is that whenever I am working with any other cell not within my Target.Column I would like the Calendar1 not to show any more.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Column
Case 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
If Calendar1.Visible Then Calendar1.Visible = False
Calendar1.Left = Target.Left + Target.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Calendar1.Value = Date
Case Else
End Select
End Sub
I'm not knowledgeable at all when it comes to VBA language, so I've tried different approaches with no success whatsoever. I assumed that the line If Calendar1.Visible Then Calendar1.Visible = False would do the trick but as far as I can tell, it has no relevance for this macro.
Any piece of advise is greatly appreciated.