View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Calendar with weeknumber?

Okay, it depends on where you are putting the MonthView control at....
directly on the spreadsheet or on a UserForm from within the VBA development
area.

From the spreadsheet
=====================
If you don't already have the Visual Basic toolbar showing, click...

View/Toolbars/Visual Basic

on Excel's menu bar. On the toolbar that displays, there is an icon that
looks like a hammer and wrench crossing each other... that is the Control
Toolbox... click it and then click the same looking icon on the panel that
displays (the ToolTip for it says "More Controls"). From the list box that
appears, select Microsoft MonthView Control 6 (at least, it shows 6 on my
system). That will place a MonthView control on the spreadsheet directly.
Right click the MonthView calendar that appears and click on Properties in
the popup menu that appears. Set the ShowWeekNumbers property to True to
show the week numbers on the calendar. You might have to change the
TitleBackColor property in order to make the numbers easier to see
(depending on the theme setting for your copy of Windows). You can use the
LinkedCell property to specify the cell you want to show the selected date.

On a UserControl
====================
Right click the Sheet1 tab at the bottom of the sheet and select View Code
from the popup menu (or press Alt+F11) to get into the VBA editor. You can
add a UserForm to your project by clicking Insert/UserForm from the VBA
editor's menu bar. Right click anywhere on the Toolbox panel that comes up
with the UserForm when you add it. Find Microsoft MonthView Control 6 on the
list that appears and check it off. This will put the MonthView icon into
the Toolbox... find the icon, click it and then drag-draw the control into
the Userform. If the Properties window is not showing, right click the
calendar and select Properties from the popup menu. Set the ShowWeekNumbers
property to True to show the week numbers on the calendar. You might have to
change the TitleBackColor property in order to make the numbers easier to
see (depending on the theme setting for your copy of Windows).

Okay, that makes the MonthView control available. What you do next depends
on how you want to interact with the user and what you know about how to do
that. It is a little hard to guide you further at this point.

Rick



"Steen" wrote in message
...
Hi Again

I have just taken a quick view at your suggestion, and I am not sure how
to
find and use this MonthView control. I am not a skilled vba programmer,
but
uses all the good information on your site among others.

Could you please ad a little more info on how to do?


"Steen" skrev:

Hi both of you two

I sorry that I first am back now - I havn't had time yet to test the two
suggestions, but I will do that in the weekend and come back.

/Stony

"Rick Rothstein (MVP - VB)" skrev:

I am using the Calendar Control v11, and would like to know if it
could be
possible to display the weeknumber in it as is the case in OutLook.

If you use a MonthView control instead, it has a ShowWeekNumbers
property
that can be set to True in order to display the week numbers.

Rick