LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Calendar code not working

I have the following code to bring up the Calendar control. When I
converted the excel workbook from XP version to 2007 version on my home
computer it worked fine, but when I open it on my office computer I get a
message saying "Object required". When I open the older version on my
office computer, the Calendar code works OK.
Can you please also advise what code I need to control the size of the
Calendar?

Rob

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Application.Intersect(Range("H2"), Target) Is Nothing Then
Calendar3.Left = Target.Left + Target.Width * 2 - Calendar3.Width
Calendar3.Top = Target.Top + Target.Height * 7.5
Calendar3.Visible = True
' select Today's date in the Calendar
Calendar3.Value = Date
ElseIf Calendar3.Visible Then Calendar3.Visible = False
End If
End Sub


 
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
Filter isn't working with a VBA Code [email protected] Excel Worksheet Functions 8 June 15th 06 01:20 PM
How do I make a working calendar mikelove Excel Worksheet Functions 1 May 16th 05 10:13 PM
how do I adjust working calendar (6 day work week) in excel that . Hatem Excel Worksheet Functions 1 January 25th 05 12:04 PM
Code not working and can't see why Steve Excel Discussion (Misc queries) 3 December 31st 04 03:12 PM
Often-Used Code not working in a new Workbook Steve Excel Discussion (Misc queries) 2 December 16th 04 11:55 PM


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