Insert calender into a cell

  • Thread starter Thread starter Deepa7476
  • Start date Start date
D

Deepa7476

hi
i what to know

- "how to insert the calender control in to a cell?"so that i will
avoid the hassle of manually entering the date
- Is it possible to extend this functionality to the entire column?
- Is it possible to create a look-up (with a drop box having list of
values)? to an individual cell.

thnkx frinds
 
Dear Tom
Thanks for the link
The link was a great help and the code works great and suits perfectly
to my requirement
The look up works fine now
thnx
Deepa
 
After seeing this thread, i decided to test it out (I was seein
http://www.rondebruin.nl/calendar.htm)


PHP code
-------------------

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
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
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Su
-------------------


But when i click on a cell with range A1:A20, it gives me a run tim
error 424 on *"Calendar1.Left = Target.Left + Target.Width
Calendar1.Width"*

Why?

Tom said:
Ron de Bruin provides some sample code at his site:

http://www.rondebruin.nl/calendar.htm

For the lookup, look at Data=>Validation and select the list option.
For
more information, you can look at Debar Dalgleish's site:

http://www.contextures.com/tiptech.html

--
Regards,
Tom Ogilvy
 
hi
i cross cheked my code with that u have posted..
its the same
and its working perfectly well for me
the calender is displyed between A1-A20 and the value take
accordingly

sorry i couldnt be of help
good luck
Deep
 
Hi Infinity

Is the name of the Calendar control on your sheet Calendar1?


--
Regards Ron de Bruin
http://www.rondebruin.nl


Infinity said:
After seeing this thread, i decided to test it out (I was seeing
http://www.rondebruin.nl/calendar.htm)


PHP code:
--------------------

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
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
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
--------------------


But when i click on a cell with range A1:A20, it gives me a run time
error 424 on *"Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width"*

Why?
[/QUOTE]
[/QUOTE]
 
Ok i know why, I didnt insert-object to place a calendar control

how do i do this? I have already install the addin.
 
Read the webpage

Use Insert-Object on the Worksheet Menu Bar to place a Calendar control on your sheet.
It is possible you don't see it in the list, because it is installed with Access.
So if you don't have that program installed you possible don't have the control.
You can download it on the website on the bottom of this page if you don't have it.
 

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

Back
Top