Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default calendar control in 3 columns

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default calendar control in 3 columns

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar control gramps Excel Discussion (Misc queries) 1 December 10th 06 11:22 PM
Calendar Control xertef Setting up and Configuration of Excel 2 July 11th 06 04:41 AM
Calendar Control Roleeb Excel Worksheet Functions 7 March 19th 06 09:15 AM
calendar control 10.0 timmulla Excel Discussion (Misc queries) 1 December 1st 05 12:38 AM
Calendar Control 11.0 MCorn Excel Discussion (Misc queries) 1 August 3rd 05 06:04 PM


All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"