ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calendar Control - Display Issue (https://www.excelbanter.com/excel-programming/316376-calendar-control-display-issue.html)

AG[_5_]

Calendar Control - Display Issue
 
[Excel2000-WIn98SE and Excel2002SP2-Win2000]

I am having a display quirk with a template using the following code
(credit to Ron De Bruin) in that the Calendar Control 8 is very slow to
hide once the cell is selected (it displays very quickly). I have tested
different video resolutions and video drivers from 5 of our ~800
computers to no avail).

If this is a Excel issue, given that I only need three cells with a
specific date format (for calculations and rate formats), one option
would be to duplicate the macro 3 times and paste each value
independently from a macro button. I would appreciate any help on the
code to paste the value in the cell as I have not been successful.

Option Explicit
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
' ActiveCell.NumberFormat = "dd-mmmm-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("AN6,AT6"), 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

Thanks,
KC


All times are GMT +1. The time now is 10:33 PM.

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