The IsDate function returns True or False indicating whether the input
value is in fact a date. In your code, IsDate evaluates the contents
of C3 and if it is a date, IsDate returns True. If C3 is not a date,
IsDate returns False.
You can simply get rid of IsDate:
Change
cell.Offset(5, 0) = IsDate(Range("C3"))
to
cell.Offset(5, 0) = Range("C3").Value
or
cell.Offset(5,0) = Format(Range("C3").Value, "m/d/yyyy")
selection.NumberFormat = "m/d/yyyy"
This refers to the cell(s) that is presently selected, which very well
may not be cell.Offset(5,0). It is probably better to use
cell.Offset(5,0).NumberFormat = "m/d/yyyy"
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
On Fri, 6 Feb 2009 08:47:03 -0800, jeremiah
wrote:
I need the following to return the value of the cell, not the word "TRUE", I
have tried multiple ways to get this with no luck. Am sure it is an obvious
change.
For Each cell In Range("b:b")
If cell.Value Like "* Totals" Then
cell.Offset(5, 0) = IsDate(Range("C3"))
selection.NumberFormat = "m/d/yyyy"
End If