![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: Mar 2006
Posts: 5
|
Thats Great !
The way you explaned is terrefic. Keep it up Thanks |
|
|
|
|
|
#2 |
|
Join Date: Jul 2003
Location: Georgia
Posts: 1,351
|
I was looking for something similar and found this tutorial. Uses current date, and the calendar pops up when the cell is selected. Hope this helps someone. http://www.rondebruin.nl/calendar.htm
|
|
|
|
|
|
#3 |
|
Join Date: Nov 2005
Location: Tokyo
Posts: 47
|
i love this little calendar. So do many other people i work with.
i'd like to 2nd this question. ** Is there any way to make it reflect today's date?? *** Would love some help on this. A simple point in the right direction would do. Regards from Tokyo |
|
|
|
|
|
#4 | |
|
Join Date: Mar 2007
Posts: 53
|
Quote:
Code:
Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell = Calendar1
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("C3:C5"), Target) Is Nothing Then
Calendar1.Left = Target.Left + (Target.Width * 1.1)
Calendar1.Top = Target.Top
Calendar1.Visible = True
Calendar1.Value = Date ' set calendar to today's date
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
the only think I can't get to work is I only want the calendar to appear in cells C3 and C5, but not C4. Any idea how to edit the range appropriately? |
|
|
|
|
|
|
#5 |
|
Join Date: Nov 2005
Location: Tokyo
Posts: 47
|
Hmmm. i don't know how to skip C4 in the above code.
i used the code you provided and i get an error: Runtime Error'424': object required ----i have the following in my sheet. Maybe there's a conflict with the first one??? ---- Any ideas to get it to work? Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If IsDate(Target) Or Target.Value = "mm/dd/yy" Then GetDate End Sub Private Sub Calendar1_DblClick() ActiveCell.NumberFormat = "mm/dd/yy" ActiveCell = Calendar1 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("C3:C5"), Target) Is Nothing Then Calendar1.Left = Target.Left + (Target.Width * 1.1) Calendar1.Top = Target.Top Calendar1.Visible = True Calendar1.Value = Date ' set calendar to today's date ElseIf Calendar1.Visible Then Calendar1.Visible = False End If End Sub |
|
|
|
|
|
#6 | |
|
Join Date: Mar 2007
Posts: 53
|
Quote:
Sorry I can't help any more than that.[/code] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|