Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default help with debug "drop down calendar"

I copy/past this code in a test and got a run time error 424.when i hit
debug it shows line "Else: Calendar1.Visible = False"this is the code i got
from http://www.rondebruin.nl/calendar.htmit was on another newsgroupe i
was watching Thanks for any and all help you can give
RustyPrivate Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/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("A1:A20"), 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default help with debug "drop down calendar"

Hi rusty

Have you add a Calendar control on your sheet first ?
Is the name of that control "Calendar1"

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rusty" wrote in message ...
I copy/past this code in a test and got a run time error 424.when i hit
debug it shows line "Else: Calendar1.Visible = False"this is the code i got
from http://www.rondebruin.nl/calendar.htmit was on another newsgroupe i
was watching Thanks for any and all help you can give
RustyPrivate Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/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("A1:A20"), 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default help with debug "drop down calendar"

I must of missed that, I redid it and it works great. Thank You


"Ron de Bruin" wrote in message
...
Hi rusty

Have you add a Calendar control on your sheet first ?
Is the name of that control "Calendar1"

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rusty" wrote in message

...
I copy/past this code in a test and got a run time error 424.when i hit
debug it shows line "Else: Calendar1.Visible = False"this is the code i

got
from http://www.rondebruin.nl/calendar.htmit was on another newsgroupe

i
was watching Thanks for any and all help you can give
RustyPrivate Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/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("A1:A20"), 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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default help with debug "drop down calendar"

OK here's the deal
I tried the code on a test workbook, found the insert Object/Calendar
Control 8
it works great:
then I tried it on my workbook and get: Compile error: Ambiguous name
detected:worksheet_Selection change.
I think it has to do with the code that was already the

Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now
Close #1
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub
not sure what it is or if i should deleate it
Thanks for any help


"Ron de Bruin" wrote in message
...
Hi rusty

Have you add a Calendar control on your sheet first ?
Is the name of that control "Calendar1"

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rusty" wrote in message

...
I copy/past this code in a test and got a run time error 424.when i hit
debug it shows line "Else: Calendar1.Visible = False"this is the code i

got
from http://www.rondebruin.nl/calendar.htmit was on another newsgroupe

i
was watching Thanks for any and all help you can give
RustyPrivate Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/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("A1:A20"), 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default help with debug "drop down calendar"

Hi Rusty

You can have only one SelectionChange event in a worksheet module

You can delet this empty one

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rusty" wrote in message ...
OK here's the deal
I tried the code on a test workbook, found the insert Object/Calendar
Control 8
it works great:
then I tried it on my workbook and get: Compile error: Ambiguous name
detected:worksheet_Selection change.
I think it has to do with the code that was already the

Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now
Close #1
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub
not sure what it is or if i should deleate it
Thanks for any help


"Ron de Bruin" wrote in message
...
Hi rusty

Have you add a Calendar control on your sheet first ?
Is the name of that control "Calendar1"

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rusty" wrote in message

...
I copy/past this code in a test and got a run time error 424.when i hit
debug it shows line "Else: Calendar1.Visible = False"this is the code i

got
from http://www.rondebruin.nl/calendar.htmit was on another newsgroupe

i
was watching Thanks for any and all help you can give
RustyPrivate Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/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("A1:A20"), 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










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
how can I disable "cutting cells" and "drag and drop "in excel ? mwoody Excel Worksheet Functions 4 August 25th 08 03:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Not able to "Step in" - Debug Hari[_3_] Excel Programming 3 June 15th 04 03:59 AM


All times are GMT +1. The time now is 05:53 AM.

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"