LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA Formatting cells by Date Range

Conditional formatting for a date range

--------------------------------------------------------------------------------

Is someone able to assist.

I have a spreadsheet that lists the staff and which task they are t
perform on a given day. (Spreadsheet Name is Allocations)

Column A has the dates for a whole year starting at row 5

Row 4, Columns B to AD list the Staff Names

Row 5 onwards for Column B to AD lists the tasks. This way I can find
date in Column A, look across that row for a task, and see who is t
perform it.

Example:

Date Staff A Staff B Staff C
1/1/04 Zaa Zxy Zbg
2/1/04 Zxy Zbg Zaa
3/1/04 Zbg Zaa Zxy
4/1/04 Zaa Zxy Zbg
5/1/04 Zxy Zbg Zaa



The leave details are on another worksheet in 3 columns. (Spreadshee
Name is Leave)

These columns a

A. Name
B. Start Date
C. Finish Date

Example:

Name StartDate Finish Date
StaffA 1/1/04 2/1/04
StaffB 3/1/04 5/1/04
StaffC 2/1/04 4/1/04
StaffA 4/1/04 5/1/04

I need some code to colour the cells for a staff members allocation
when they are on leave.

Colour used is "VIOLET"

As can be seen by STAFFA, above, sometimes staff have 2 or more leav
periods in a year. eg 2 weeks in March, 2 weeks in October

The code therefore needs to:

1. Look at staff Name on Leave Sheet.
2. Find corresponding Name in Row 4 on Allocation Sheet.
3. Look at Start Date and Finish Date on Leave Sheet.
4. Colour that range for that staff member on Allocation Sheet.

With the above example the following cells marked X would be shade
Violet.

Date Staff A Staff B Staff C
1/1/04 X - -
2/1/04 X - X
3/1/04 - X X
4/1/04 X X X
5/1/04 X X -


Variables:
Sometimes there are more or less Staff Members.

Staff may have 2 or more leave periods.


I have already used the three Conditional Formatting options t
highlight various tasks, so need code to shade the cells

I have very limited knowledge of macros and code, and dont know if thi
is possible.

Could someone please assist.

cheers
Koal

--
Message posted from http://www.ExcelForum.com

 
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
Clarification - how to automatically update cells with a date and date range Bekki Excel Discussion (Misc queries) 1 August 31st 10 03:18 AM
Conditional Formatting Date Range BWR_Rick Excel Worksheet Functions 1 April 16th 10 02:25 AM
How to format range of cells using Conditional Formatting-Excel? bookmanu3 Excel Worksheet Functions 2 June 14th 08 03:39 AM
Date Range Conditional Formatting Lynn Excel Worksheet Functions 13 March 30th 08 02:18 AM
Excel: Toolbar button for Formatting cells to date STYLES etc Pauline from Perth Aus. Setting up and Configuration of Excel 0 June 6th 06 03:46 AM


All times are GMT +1. The time now is 01:37 PM.

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

About Us

"It's about Microsoft Excel"