Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having trouble trying to compare dates that are in a worksheet cell
against a date placed in a Textbox. Here's the code: If Cells(Drow, 5).Value < TextStart.Value And Not (Left(Cells(Drow, 10).Value, 1) Like "[D]") Then Rows(Drow).Select Selection.Interior.ColorIndex = 34 End If The problem is that it changes all the cells to colorindex 34. I need it to only change the colorindex of those rows that are prior to the textStart.value Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this .... assuming TextStart is a text string which needs to be converted
to a date format for the comparison with your Cell (presumably formtted s Date). HTH If Cells(Drow, 5).Value < Datevalue(TextStart.Value) And Not (Left(Cells(Drow, "asmenut" wrote: I am having trouble trying to compare dates that are in a worksheet cell against a date placed in a Textbox. Here's the code: If Cells(Drow, 5).Value < TextStart.Value And Not (Left(Cells(Drow, 10).Value, 1) Like "[D]") Then Rows(Drow).Select Selection.Interior.ColorIndex = 34 End If The problem is that it changes all the cells to colorindex 34. I need it to only change the colorindex of those rows that are prior to the textStart.value Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Topper,
Must of had a loss of brain. I should have caught this. I officially demote myself from developer to idiot. Thanks again for the help. "Toppers" wrote: Try this .... assuming TextStart is a text string which needs to be converted to a date format for the comparison with your Cell (presumably formtted s Date). HTH If Cells(Drow, 5).Value < Datevalue(TextStart.Value) And Not (Left(Cells(Drow, "asmenut" wrote: I am having trouble trying to compare dates that are in a worksheet cell against a date placed in a Textbox. Here's the code: If Cells(Drow, 5).Value < TextStart.Value And Not (Left(Cells(Drow, 10).Value, 1) Like "[D]") Then Rows(Drow).Select Selection.Interior.ColorIndex = 34 End If The problem is that it changes all the cells to colorindex 34. I need it to only change the colorindex of those rows that are prior to the textStart.value Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to compare a cell containing a date in sumif criteria | Excel Worksheet Functions | |||
Compare multiple dates, can enumerate cell based on most recent date | Excel Worksheet Functions | |||
Compare dates (one cell not in date format) | Excel Discussion (Misc queries) | |||
Compare Date in Cell VS a Variable Date to Hide Row | Excel Programming | |||
converting date from a textbox to a date format | Excel Programming |