ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pick a date from a cell drop down calendar (https://www.excelbanter.com/excel-discussion-misc-queries/117341-pick-date-cell-drop-down-calendar.html)

Paul Dennis

Pick a date from a cell drop down calendar
 
I have put a calendar pop up in a cell after looking how on
http://www.rondebruin.nl/calendar.htm

It all works for me and most others, but some people are getting a vb error
not just on this cell but all cells. The error is Compile Error" "Can't find
project or library".

It has been sugested that the error is due to the Calendar control being a
part of Access ? Is this true ? If so is there a way around this as I can't
ask people to install Access?


Ron de Bruin

Pick a date from a cell drop down calendar
 
Hi Paul

Yes that is true
See the link I have on my site to the page with the useform example
you can download the control there if you want

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



"Paul Dennis" wrote in message ...
I have put a calendar pop up in a cell after looking how on
http://www.rondebruin.nl/calendar.htm

It all works for me and most others, but some people are getting a vb error
not just on this cell but all cells. The error is Compile Error" "Can't find
project or library".

It has been sugested that the error is due to the Calendar control being a
part of Access ? Is this true ? If so is there a way around this as I can't
ask people to install Access?




Paul Dennis

Pick a date from a cell drop down calendar
 
I replaced the code but it didn't make any difference

from:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$I$30" Then 'Change this
Calendar1.Visible = True
Calendar1.Value = Date
Else
Calendar1.Visible = False
End If
End Sub

to:

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "dd/mm/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("I30"), 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

"Ron de Bruin" wrote:

Hi Paul

Yes that is true
See the link I have on my site to the page with the useform example
you can download the control there if you want

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



"Paul Dennis" wrote in message ...
I have put a calendar pop up in a cell after looking how on
http://www.rondebruin.nl/calendar.htm

It all works for me and most others, but some people are getting a vb error
not just on this cell but all cells. The error is Compile Error" "Can't find
project or library".

It has been sugested that the error is due to the Calendar control being a
part of Access ? Is this true ? If so is there a way around this as I can't
ask people to install Access?





Ron de Bruin

Pick a date from a cell drop down calendar
 
???

It has been sugested that the error is due to the Calendar control being a
part of Access ? Is this true ? If so is there a way around this as I can't
ask people to install Access?


See
http://www.fontstuff.com/mailbag/qvba01.htm



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



"Paul Dennis" wrote in message ...
I replaced the code but it didn't make any difference

from:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$I$30" Then 'Change this
Calendar1.Visible = True
Calendar1.Value = Date
Else
Calendar1.Visible = False
End If
End Sub

to:

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "dd/mm/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("I30"), 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

"Ron de Bruin" wrote:

Hi Paul

Yes that is true
See the link I have on my site to the page with the useform example
you can download the control there if you want

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



"Paul Dennis" wrote in message ...
I have put a calendar pop up in a cell after looking how on
http://www.rondebruin.nl/calendar.htm

It all works for me and most others, but some people are getting a vb error
not just on this cell but all cells. The error is Compile Error" "Can't find
project or library".

It has been sugested that the error is due to the Calendar control being a
part of Access ? Is this true ? If so is there a way around this as I can't
ask people to install Access?








All times are GMT +1. The time now is 03:20 PM.

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