Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Repost- problem with calender control

I posted this last night but it might have be a bit late.

I'm having a problem with the calender control. It works
fine until I protect the sheet, then I get a run time error
'1004'.
When I hit debug, ActiveCell.NumberFormat = "dd-mmm-yy" is
hilighted in yellow.

Here is the code.

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "dd-mmm-yy"
ActiveCell = Calendar1.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Range("J9,J10,J11,BP4"),
Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub

I'm using Excel 2003.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Repost- problem with calender control

Hi
one idea (not tested): Prior to protecting the sheet you should enable
data entries for the specific cells ('Format - Cells - Protection') as
you're trying to insert values in cells on your protected sheet

Another one would be to unprotect the sheet at the beginning of your
code and to re-protect it after you inserted your values


--
Regards
Frank Kabel
Frankfurt, Germany

Tim wrote:
I posted this last night but it might have be a bit late.

I'm having a problem with the calender control. It works
fine until I protect the sheet, then I get a run time error
'1004'.
When I hit debug, ActiveCell.NumberFormat = "dd-mmm-yy" is
hilighted in yellow.

Here is the code.

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "dd-mmm-yy"
ActiveCell = Calendar1.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Range("J9,J10,J11,BP4"),
Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub

I'm using Excel 2003.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Repost- problem with calender control

Hi Tim

It don't like the separate format line on a protected sheet

Use this

Private Sub Calendar1_DblClick()
ActiveCell = Format(Calendar1.Value, "dd-mmm-yy")
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in message ...
I posted this last night but it might have be a bit late.

I'm having a problem with the calender control. It works
fine until I protect the sheet, then I get a run time error
'1004'.
When I hit debug, ActiveCell.NumberFormat = "dd-mmm-yy" is
hilighted in yellow.

Here is the code.

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "dd-mmm-yy"
ActiveCell = Calendar1.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Range("J9,J10,J11,BP4"),
Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub

I'm using Excel 2003.



  #4   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Repost- problem with calender control

Neither did Excel, that fixed the problem.

Thanks Ron




-----Original Message-----
Hi Tim

It don't like the separate format line on a protected sheet

Use this

Private Sub Calendar1_DblClick()
ActiveCell = Format(Calendar1.Value, "dd-mmm-yy")
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in

message ...
I posted this last night but it might have be a bit late.

I'm having a problem with the calender control. It works
fine until I protect the sheet, then I get a run time error
'1004'.
When I hit debug, ActiveCell.NumberFormat = "dd-mmm-yy" is
hilighted in yellow.

Here is the code.

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "dd-mmm-yy"
ActiveCell = Calendar1.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As

Range)
If Not Application.Intersect(Range("J9,J10,J11,BP4"),
Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub

I'm using Excel 2003.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Repost- problem with calender control

Neither did Excel
I mean Excel <g

I changed it on my page also
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in message ...
Neither did Excel, that fixed the problem.

Thanks Ron




-----Original Message-----
Hi Tim

It don't like the separate format line on a protected sheet

Use this

Private Sub Calendar1_DblClick()
ActiveCell = Format(Calendar1.Value, "dd-mmm-yy")
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in

message ...
I posted this last night but it might have be a bit late.

I'm having a problem with the calender control. It works
fine until I protect the sheet, then I get a run time error
'1004'.
When I hit debug, ActiveCell.NumberFormat = "dd-mmm-yy" is
hilighted in yellow.

Here is the code.

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "dd-mmm-yy"
ActiveCell = Calendar1.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As

Range)
If Not Application.Intersect(Range("J9,J10,J11,BP4"),
Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width -
Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub

I'm using Excel 2003.



.





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
Calender Control WLMPilot Excel Discussion (Misc queries) 3 March 15th 08 04:06 PM
Microsoft Calender Control 11.0 akim612 Excel Discussion (Misc queries) 1 January 19th 05 09:24 PM
problem with calender control Tim Excel Programming 3 February 20th 04 03:55 PM
Repost: Calendar Control: Ron De Bruin Michael[_10_] Excel Programming 4 August 11th 03 09:25 PM
Calender Control VB Michael[_10_] Excel Programming 1 August 11th 03 10:21 AM


All times are GMT +1. The time now is 09:20 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"