Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Sample data in Activesheet --Row-------A-----------------B----------------------------- 1 Number <== Label 2 1 <==First number 3 2 4 3 .. . .. . .. . 29995 29994 29996 29995 29997 1000 <== out of order 29998 29997 29999 29998 30000 29999 30001 30000 ------------------------------------------------------------ Try the following code: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Option Explicit Sub TEST() Dim R As Long Dim N As Double R = Cells(Rows.Count, 1).End(xlUp).Row If R < 3 Then GoTo e: N = Evaluate("MIN(IF(A2:A" & (R - 1) & "A3:A" & _ R & ",ROW(A3:A" & R & "),""""))") If N = 0 Then GoTo e: Range("A" & R & ":A" & N).EntireRow.Delete e: End Sub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
delete empty rows between rows with text | Excel Discussion (Misc queries) |