Dear all
On attached sheet I want to delete all the rows if it is not a date on Column A with a macro?
Can you please help how to write it?
please see attached
Many thanks
Dear all
On attached sheet I want to delete all the rows if it is not a date on Column A with a macro?
Can you please help how to write it?
please see attached
Many thanks
based on your sample file it may be easier to base the deletion on F given these are seemingly only non-blank where the value in A is a date, eg:
Please Login or Register to view this content.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
You may use this macro below...
Sub DeleteRow_if_it_is_not_Date()
Dim A_Value As Boolean
Range("A65536").Select
Selection.End(xlUp).Select
i = ActiveCell.Row
For r = i To 1 Step -1
If Not IsDate(Cells(r, 1).Value) Then
Rows(r & ":" & r).EntireRow.Delete
End If
Next r
End Sub
Last edited by Atila Akal; 08-10-2009 at 12:04 PM.
Thanks mate ,it worked.
They both have worked. Thank you again for all the reply.
No problem, using SpecialCells will be faster than Iterating the range.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks