Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading Dates
Below is a small bit of code that will make a row bold depending on value in column Q. I can make it work if the value in Q is text, however I need it to rea a datevalue. Is there a way to do this? What I really would like to be able to do (though I was going to tr and work that one out for myself, small steps) is to make it referanc two dates in cell user definable cells and bold anything they input But the first step is to make it read dates.. Any ideas? Code ------------------- Sub bold() Set Rng = Range("Q1:Q5000") For Each cl In Rng If cl.Value = "21/03/06" Then cl.EntireRow.Font.bold = True End If Nex ------------------- Thanks Very much End Su -- Odysseu ----------------------------------------------------------------------- Odysseus's Profile: http://www.excelforum.com/member.php...fo&userid=1456 View this thread: http://www.excelforum.com/showthread.php?threadid=52486 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading Dates
How about this one?
For Each cl In Rng If format(cl.Value, "dd/mm/yy") = "21/03/06" Then cl.EntireRow.Font.bold = True End If Next Frederick Chow Hong Kong "Odysseus" wrote in message ... Below is a small bit of code that will make a row bold depending on a value in column Q. I can make it work if the value in Q is text, however I need it to read a datevalue. Is there a way to do this? What I really would like to be able to do (though I was going to try and work that one out for myself, small steps) is to make it referance two dates in cell user definable cells and bold anything they input. But the first step is to make it read dates.. Any ideas? Code: -------------------- Sub bold() Set Rng = Range("Q1:Q5000") For Each cl In Rng If cl.Value = "21/03/06" Then cl.EntireRow.Font.bold = True End If Next -------------------- Thanks Very much End Sub -- Odysseus ------------------------------------------------------------------------ Odysseus's Profile: http://www.excelforum.com/member.php...o&userid=14563 View this thread: http://www.excelforum.com/showthread...hreadid=524866 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading Dates
Thanks, that part worked a treat. Though I now need to make the date varialbe to be enterd into Cell A1. I tried the just sticking in A that didn't work so I tryied the below, that also didn't work. Am I on the right track or am I way off here ? For Each cl In Rng If Format(cl.Value, "dd/mm/yy") = Format("A1", "dd/mm/yy") Then cl.EntireRow.Font.bold = Tru -- Odysseu ----------------------------------------------------------------------- Odysseus's Profile: http://www.excelforum.com/member.php...fo&userid=1456 View this thread: http://www.excelforum.com/showthread.php?threadid=52486 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copnvert dates reading as Text to a date format | Excel Discussion (Misc queries) | |||
reading from SQL | Excel Discussion (Misc queries) | |||
Reading dates from text file | Excel Programming | |||
reading/inserting variable dates within a macro | Excel Programming | |||
sub for reading | Excel Programming |