Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Guys,
I Have dates in the range D3:D369, from 1 jan to 31 dec (in that format). Now I want to highlight the holidays in that range, but i'm having difficulties with that. I've created a collection, en i'm trying to use a For Each... Next to loop through the range. I also want this procedure to start automatically when i open up the workbook, so in module 1 this doesn't seem to work, and I have no idea where en how i should get this done... What i've tried: Sub Toef() Dim hCollection As New Collection Dim newyear, easter, daym, ascension, ... As String Dim DateRange As Date Dim allSheets As Worksheets DateRange = allSheets.range("D3:D369").Select newyear= "1 jan" easter= "16 apr" daym= "1 may" ascension= "24 mei" .... hCollection.Add (newyear) hCollection.Add (easter) hCollection.Add (daym) hCollection.Add (ascension) .... For Each DateRange In hCollection DateRange.Item.Color = RGB(0, 255, 0) Next DateRange.Item End Sub Thanks in advance guys, Memento |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
National Holidays - Dates | Excel Discussion (Misc queries) | |||
Calculating dates of holidays | Excel Worksheet Functions | |||
Write Holidays between two dates? | Excel Worksheet Functions | |||
How to exlude holidays from a range of dates | Excel Discussion (Misc queries) | |||
Dates with Holidays question | Excel Discussion (Misc queries) |