Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Active X CAlender day colour

Dear All,

This maybe a very simple question but I have created a calender in excel
using active X I was wondering how I would go about colouring in for example
every Wednesday of that month so they stand out I have looked in all the
properties and I haven't found a way

Kind regards Joel
--
N/A
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Active X CAlender day colour

On Mar 21, 4:08 pm, Joel wrote:
Dear All,

This maybe a very simple question but I have created a calender in excel
using active X I was wondering how I would go about colouring in for example
every Wednesday of that month so they stand out I have looked in all the
properties and I haven't found a way

Kind regards Joel
--
N/A


Hello Joel,

If you are referring to a MonthView control, you can bold the days you
want. Since this control has a window handle, it might be possible to
use the API to color the selected dates, but I not sure it would be
worth the effort to make the dates stand out.

Here are the code routines to bold the Wednesdays month by month. The
MonthView is on a UserForm.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sub BoldWednesdays()

Dim D As Variant
Dim FirstDay As Long
Dim LastDay As Long
Dim M As Long, y As Long

With MonthView1
y = .Year
M = .Month
End With

FirstDay = DateSerial(y, M, 1)
LastDay = DateSerial(y, M + 1, 1) - 1

DoEvents

For D = FirstDay To LastDay
If Weekday(D, vbSunday) = 4 Then
MonthView1.DayBold(D) = True
End If
Next D

End Sub

Private Sub MonthView1_MouseMove(ByVal Button As Integer, ByVal Shift
As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As
stdole.OLE_YPOS_PIXELS)

Dim Ret

Ret = MonthView1.HitTest(x, y, MonthView1.Value)
Select Case Ret
Case Is = 8, 9
BoldWednesdays
End Select

End Sub

Private Sub UserForm_Activate()

BoldWednesdays

End Sub
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sincerely,
Leith Ross
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Active X CAlender day colour

Hi thanks for the code, I have tried and can't seem to get it work. I am
double clicking the calender and pasting the code in to there. Please can you
help

Thanks Joel
--
N/A


"Leith Ross" wrote:

On Mar 21, 4:08 pm, Joel wrote:
Dear All,

This maybe a very simple question but I have created a calender in excel
using active X I was wondering how I would go about colouring in for example
every Wednesday of that month so they stand out I have looked in all the
properties and I haven't found a way

Kind regards Joel
--
N/A


Hello Joel,

If you are referring to a MonthView control, you can bold the days you
want. Since this control has a window handle, it might be possible to
use the API to color the selected dates, but I not sure it would be
worth the effort to make the dates stand out.

Here are the code routines to bold the Wednesdays month by month. The
MonthView is on a UserForm.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sub BoldWednesdays()

Dim D As Variant
Dim FirstDay As Long
Dim LastDay As Long
Dim M As Long, y As Long

With MonthView1
y = .Year
M = .Month
End With

FirstDay = DateSerial(y, M, 1)
LastDay = DateSerial(y, M + 1, 1) - 1

DoEvents

For D = FirstDay To LastDay
If Weekday(D, vbSunday) = 4 Then
MonthView1.DayBold(D) = True
End If
Next D

End Sub

Private Sub MonthView1_MouseMove(ByVal Button As Integer, ByVal Shift
As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As
stdole.OLE_YPOS_PIXELS)

Dim Ret

Ret = MonthView1.HitTest(x, y, MonthView1.Value)
Select Case Ret
Case Is = 8, 9
BoldWednesdays
End Select

End Sub

Private Sub UserForm_Activate()

BoldWednesdays

End Sub
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sincerely,
Leith Ross

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
Active cell default colour Boyd Excel Discussion (Misc queries) 1 October 23rd 08 12:50 AM
Change tab colour for active sheet Helge V. Larsen Excel Programming 6 August 8th 07 03:02 PM
How I can change colour of row and column which are active ? hb Excel Discussion (Misc queries) 1 September 18th 06 01:49 PM
Highlighting the active row with special colour Raj Mazumdar Excel Discussion (Misc queries) 5 January 20th 06 03:46 PM
Colour active row but allow copy / paste [email protected] Excel Programming 3 January 20th 06 10:52 AM


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