Thread: macro help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default macro help

Sasikiran

Try the below macro which works on activesheet. Col B. Backup your data and
test.

Sub Macro()
Dim lngRow As Long
Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For lngRow = lngLastRow To 1 Step -1
If Second(Range("B" & lngRow)) < 0 Then Rows(lngRow).Delete
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Sasikiran" wrote:

Dear,

I need a macro to delete the entire row if the seconds data in the cell is
other than 00.

The data in column B is in h:mm:ss AM/PM format. If the time is other than
00 it displays in the cell. All the rows which has seconds value other than
00 should be deleted.

Thanks in advance.