ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if cell is not date format delete row (https://www.excelbanter.com/excel-programming/405882-if-cell-not-date-format-delete-row.html)

burl_h

if cell is not date format delete row
 
I'm having a little trouble with this one, I'm trying to delete all
rows where the cells within the selected range are not formatted as
date.

Sub delete_date()
Dim datarng As Range
lastrow = Cells(Rows.Count, "B").End(xlUp).row
Set datarng = Range ("b2:b" & lastrow)


All times are GMT +1. The time now is 12:26 PM.

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