Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If I change the range to include 2 columns it still works
If Not Application.Intersect(Range("A2:A200", "F2:F200"), Target) Is Nothing Then But if I add a third it doesn't work... is there a way to make it? If Not Application.Intersect(Range("A2:A200", "F2:F200", "G2:G200"), Target) Is Nothing Then here is the starting code: Private Sub Calendar1_Click() ActiveCell.Value = CDbl(Calendar1.Value) ' ActiveCell.NumberFormat = "dd/mmm/yy" 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("A2:A200"), 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 If IsDate(ActiveCell.Value) Then Calendar1.Value = DateValue(ActiveCell.Value) Else Calendar1.Value = Date End If End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi tmirelle
See the example on my site Note: you can use this if your range is not one area If Not Application.Intersect(Range("A1:A20,C1,E1"), Target) Is Nothing Then -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "tmirelle" wrote in message ... If I change the range to include 2 columns it still works If Not Application.Intersect(Range("A2:A200", "F2:F200"), Target) Is Nothing Then But if I add a third it doesn't work... is there a way to make it? If Not Application.Intersect(Range("A2:A200", "F2:F200", "G2:G200"), Target) Is Nothing Then here is the starting code: Private Sub Calendar1_Click() ActiveCell.Value = CDbl(Calendar1.Value) ' ActiveCell.NumberFormat = "dd/mmm/yy" 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("A2:A200"), 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 If IsDate(ActiveCell.Value) Then Calendar1.Value = DateValue(ActiveCell.Value) Else Calendar1.Value = Date End If End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks!
"Ron de Bruin" wrote: Hi tmirelle See the example on my site Note: you can use this if your range is not one area If Not Application.Intersect(Range("A1:A20,C1,E1"), Target) Is Nothing Then -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "tmirelle" wrote in message ... If I change the range to include 2 columns it still works If Not Application.Intersect(Range("A2:A200", "F2:F200"), Target) Is Nothing Then But if I add a third it doesn't work... is there a way to make it? If Not Application.Intersect(Range("A2:A200", "F2:F200", "G2:G200"), Target) Is Nothing Then here is the starting code: Private Sub Calendar1_Click() ActiveCell.Value = CDbl(Calendar1.Value) ' ActiveCell.NumberFormat = "dd/mmm/yy" 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("A2:A200"), 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 If IsDate(ActiveCell.Value) Then Calendar1.Value = DateValue(ActiveCell.Value) Else Calendar1.Value = Date End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calendar control | Excel Discussion (Misc queries) | |||
Calendar Control | Setting up and Configuration of Excel | |||
Calendar Control | Excel Worksheet Functions | |||
calendar control 10.0 | Excel Discussion (Misc queries) | |||
Calendar Control 11.0 | Excel Discussion (Misc queries) |