"Find" fails "date" search

SeniorTom

Board Regular
Joined
Jun 5, 2017
Messages
98
I search row 4 for a date m/d/yyyy. I have 2 cells that look the same, but have a different formula. Below CT4 & CU4 the “find” works, but CV4 fails. My failed cells were initially referenced to another sheet, then copy/paste values. I have reentered number format/date with no change. If I reenter the date, it finds it.

I have the work around, but would like to know what cause the difference. Any help is appreciated.

'tries to find target date in fourth row
Set FoundIt = .Range("4:4").Find(What:=NewDate, LookAt:=xlWhole, MatchCase:=False)

If FoundIt Is Nothing Then
GoTo ErrMsg
End If


Using this code I check these properties:
"Formula" is different, but I can’t find the discrepancy

Sub DispProperty()
Dim cell As Range
Set cell = Cells(4, 100) ' You can change this cell as needed
Dim msg As String

msg = "Cell Address: " & cell '.Address & vbCrLf
msg = msg & "Value: " & cell.Value & vbCrLf
msg = msg & "Font Name: " & cell.Font.Name & vbCrLf
msg = msg & "Font Size: " & cell.Font.Size & vbCrLf
msg = msg & "Font Color: " & cell.Font.Color & vbCrLf
msg = msg & "Background Color: " & cell.Interior.Color & vbCrLf
msg = msg & "Formula: " & cell.Formula & vbCrLf
msg = msg & "Number Format: " & cell.NumberFormat & vbCrLf

MsgBox msg, vbInformation, "Cell Properties"
End Sub



CT4 works
1743440584984.png



CU4 Works
1743440606187.png



CV4 fails

1743440644953.png
 
I have reentered number format/date with no change. If I reenter the date, it finds it.
That says to me that the cell was originally text and not a real date, changing the number format after the entry was made wouldn't change that.
 
Upvote 0
Solution

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top