View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
tmirelle tmirelle is offline
external usenet poster
 
Posts: 26
Default calendar control in 3 columns

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