IsDate macro missing some blank cells

Jonathan King

New Member
Joined
Dec 13, 2018
Messages
17
For some reason, IsDate is missing some blank cells and I can't seem to resolve the problem.

The blank cells have been thoroughly checked with IsBlank and IsEmpty and show as blank cells.

What happens is, the blank cells are then subtracted from a date and consistently return a -43524.

IsEmpty(.Range("I" & y).Value) was added as a second check, but some blank cells are still being missed.

Most likely, I'm missing something right before my eyes.

Any ideas?

Thanks beforehand!

----

With Sheets("Test")
lrow2 = .Cells(.Rows.Count, "A").End(xlUp).Row


For y = 1 To lrow2
If Not IsDate(.Range("I" & y).Value) Then
.Rows(y).Delete
End If
Next y

End With
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
In the case given, any cells that are not a date need to be deleted.

The empty cells issue came into play based on my incorrectly going from top-to-bottom , leading to missing cells. Once it was changed to go bottom-to-top, the missing cell issue was resolved.

There are places, where Michael's code will come in handy.
 
Upvote 0

Forum statistics

Threads
1,215,510
Messages
6,125,223
Members
449,216
Latest member
biglake87

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