calendar icon in cell

  • Thread starter That's Confidential
  • Start date
T

That's Confidential

I have various cells formatted as dates. Is there anyway I can make a little
icon appear within those cells so that you can click on this and a mini
calendar comes up for you to select the date? Similar to those you find on
holiday company websites etc etc.....

Thanks in advance
 
F

Frank Kabel

Hi
AFAIK not as a build-in function. you may have a look at the calendar
object (Insert - Objects) for this
 
J

jeff

Hi,

Yes, you can do better than that. You can adjust
the following macro to select the cells that need
a date and it'll pop up for selection. Just go
to Insert->Object->Calendar control, and add this
code. (modify to suit your needs - uses A1:A20)

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
Calendar1.Visible = False
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("A1:A20"), Target)
Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
Else: Calendar1.Visible = False
End If
End Sub

jeff
 
A

Adam

Yes, depending on what version of excel you are using..

GO to Insert > Object then select Calendar Control 11.0. This will give you a calendar that you can select and pick dates etc. To link what you've selected in the calendar double click on the calendar, in design mode' and paste in the below information into the vb window

Private Sub Calendar1_Click(
ActiveSheet.Range("a1").Value = Calendar1.Valu
End Su

If you have more than one calendar then in Value = Calendar1.Value replace with Value = Calendar2.Value etc

Hope this helps

Ada
 
Top