Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Testing cell values...

I have a workbook that consists of Sheets with Names and
Dates among other things... What I would like to do is
compare Sheet 1 Name and dates with Sheet 2 Name and
dates, and color the intesecting cell a color...

For example; the [namerange] in Sheet 1 are (A2:A10), the
[Startdate](B2:B10) and the Enddate (C2:C10)

NAME: STARTDATE: ENDDATE:
Smith 06/02/03 06/13/03
Jones 06/02/03 06/06/03
Brown... 06/09/03 06/20/03

Sheet 2 consists of TESTNAME (A2:A10) and DateRange
(B1:H1), DateRange is week ending dates...

TESTNAME: 05/23/03 05/30/03 06/06/03 06/13/03
Smith
Jones
Brown...

What I would like to accomplish is an update button, so
when I update Sheet 1, I can hit the button and it will
search Sheet 2 for the matching name, then test the
Startdate and Enddate in Sheet 1 against the DateRange in
Sheet 2 and color the cells that intersects...

This is what I have so far, but it doesn't work...

Sub Button1_Click()
Set DateRange = Worksheets("Sheet2").Range("B1:H1")
Set Startdate = Worksheets("Sheet1").Range("B2:B10")
Set Enddate = Worksheets("Sheet1").Range("C2:C10")
Set NameRange = Worksheets("Sheet1").Range("A2:A10")
Set TestName = Worksheets("Sheet2").Range("A2:A10")
For Each c In [DateRange]
If c.Value = Startdate And c.Value <= Enddate Then
If NameRange = TestName Then
Cells
(TestName.Row, .Column).Interior.ColorIndex = 35
End If
End If
Next c

End Sub

Thanks in Advance:
Kevin...




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
testing for a value in a cell Dave Eade Excel Discussion (Misc queries) 1 February 11th 10 11:54 AM
Testing a cell value Finance Guru Excel Worksheet Functions 2 January 19th 09 12:44 PM
HELP, PLEASE - Testing Multiple Values wingale Excel Discussion (Misc queries) 4 April 14th 06 10:52 PM
Testing positions in a cell MarcusA Excel Discussion (Misc queries) 2 November 4th 05 02:25 AM
IF function....testing against values in multiple cells racmb1975 Excel Worksheet Functions 2 October 12th 05 07:50 PM


All times are GMT +1. The time now is 06:43 AM.

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"