ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading Dates (https://www.excelbanter.com/excel-programming/356674-reading-dates.html)

Odysseus[_9_]

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


Frederick Chow

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




Odysseus[_10_]

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



All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com