Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a calendar object in Excel Cell

Hi,
I was wondering did anyone try to insert an calendar objcect into an Excel
Cell before.

thank you.


--
Khai Mun, Ng
-----------------------------------------------------------


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Create a calendar object in Excel Cell

Do you mean something like this Kzeto

Do Insert-Object from the menubar and place a calendar control on your
sheet.
It is possible you don't see it in the list, it is installed with Access.
So if you don't have that you possible don't have the control


Here a example how to use it

Place this in a Sheetmodule
If you select a cell in Column A the calendar will popup and when
you DblClick on the calendar the date will be placed in the activecell

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "m/d/yyyy"
ActiveCell = Calendar1
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 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


Example for one cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" 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


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



"Kzeto" wrote in message ...
Hi,
I was wondering did anyone try to insert an calendar objcect into an Excel
Cell before.

thank you.


--
Khai Mun, Ng
-----------------------------------------------------------




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Create a calendar object in Excel Cell

I have, and following works for all Workbooks OK for me. I am
using MS Office 2000

Create a form and place a Calendar Control 9.0 which you can find
from the Tools/Additional Controls/Calendar Control 9.0 menu.

Then in the Calendar Code I have
-----------------------------------------
Private Sub Calendar1_Click() ' what happens when user clicks on
control
With ActiveCell
.NumberFormat = "dd-mmm-yyyy" ' format to my preference
.Value = Format(Calendar1.Value, "dd-mmm-yyyy") ' insert
clicked date
End With
Unload Me ' closes and unloads Calendar
End Sub
-----------------------------------------
Private Sub UserForm_Initialize() ' what happens when user opens
form containing Calendar
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value) ' uses cell
value if date
Else
Calendar1.Value = Date ' uses today's date as default
End If
End Sub

-----------------------------------------
and in a general module I have
-----------------------------------------
Private Sub OpenCalander() ' user clicks button to open Calendar
frmCalendar.Show ' shows Calendar
End Sub
-----------------------------------------

I have all this in Personal.xls and a menu button to run the
OpenCalendar sub which works on all opened workbooks.

regards,
--
Les Hay, Livingston. Scotland
"Kzeto" wrote in message
...
Hi,
I was wondering did anyone try to insert an calendar objcect

into an Excel
Cell before.

thank you.


--
Khai Mun, Ng
-----------------------------------------------------------




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 Object in Excel Calendar Object in Excel Excel Discussion (Misc queries) 2 February 10th 10 10:16 PM
I want to link a cell in excel to calendar object? Stapes Excel Worksheet Functions 0 March 28th 07 12:06 AM
How do I create a Calendar Drop Down menu for a Validation cell KC73 Excel Worksheet Functions 0 April 21st 05 10:15 PM
How do I create a workbook that links info in cell to a calendar? JH Excel Worksheet Functions 2 March 30th 05 09:45 PM
Is there any way to create a drop down calendar into a cell in ex. Heavensent1 Excel Discussion (Misc queries) 1 March 11th 05 11:24 PM


All times are GMT +1. The time now is 03:27 AM.

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

About Us

"It's about Microsoft Excel"