ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calendar Control, Weekly (https://www.excelbanter.com/excel-programming/369671-calendar-control-weekly.html)

ForSale[_76_]

Calendar Control, Weekly
 

I currently have a userform with a Calendar Control 10.0 on it. Righ
now it only lets the user select one day at a time. I need a way fo
the user to select a week at a time (Mon-Sun).

What is the best method? Can I continue to use the Calendar Control?
Should I make a different userform with a listbox or combobox?

Thanks

--
ForSal
-----------------------------------------------------------------------
ForSale's Profile: http://www.excelforum.com/member.php...fo&userid=1189
View this thread: http://www.excelforum.com/showthread.php?threadid=56923


Mike Fogleman

Calendar Control, Weekly
 
You can still use the Calendar control, but you will have to build the week
using VB or cell formulas. Let's assume your user picks Wed, Aug 9, 2006 on
the calendar. That date is then placed in A20. Put the days of the week in
cells B19:H19, starting with monday. In cell B20 put this formula:
=IF(WEEKDAY(A20,2)=1,A20,A20-(WEEKDAY(A20,2)-1))
in cell C20 put: =B20+1
in cell D20 put: =C20+1
in cell E20 put: =D20+1
in cell F20 put: =E20+1
in cell G20 put: =F20+1
in cell H20 put: =G20+1

Your formulas create a week that starts on Monday 8/7/2006 and ends Sunday
8/13/2006
No matter what day of the week the user selected. Works for any week.

Mike F

"ForSale" wrote in
message ...

I currently have a userform with a Calendar Control 10.0 on it. Right
now it only lets the user select one day at a time. I need a way for
the user to select a week at a time (Mon-Sun).

What is the best method? Can I continue to use the Calendar Control?
Should I make a different userform with a listbox or combobox?

Thanks.


--
ForSale
------------------------------------------------------------------------
ForSale's Profile:
http://www.excelforum.com/member.php...o&userid=11896
View this thread: http://www.excelforum.com/showthread...hreadid=569235





All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com