![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
My spreadsheet has 2 columns of data. Column A contains part numbers and column B contains serial numbers. I frequently delete part numbers (and serial numbers) due to part discontinuations, etc which leaves many blank rows within my spreadsheet. Removing these rows individually can get time consuming (I sometimes have 40 or 50 rows of data sparatically located throughout my spreadsheet).
How can i remove the blank rows all at once? Thx, Noir |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 7,743
|
Try sorting the columns
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: OKC
Posts: 98
|
this works well...........
Sub DeleteEmptyRows() LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count Application.ScreenUpdating = False For r = LastRow To 1 Step -1 If Application.WorksheetFunction.CountA(Rows(r)) = 0 _ Then Rows(r).Delete Next r End Sub |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
Eddie,
Sorry but, i could not get your code to work. Please help. Noir |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Philippines
Posts: 55
|
Noir,
someone send me a little add-in that does just what you need. Give me your e-mail, I'll send it to you Hans |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Ahmedabad Gujarat
Posts: 303
|
Friend,
why dont you sort the rows... you will have all your blank rows at the end. nishith desai http://www.pexcel.com |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Hiya,
Seriously I'd go with Nisht and Brian's recommendations- quick and easy. If the original order of the list is needed you could add a column of sequential numbers before sorting - then resort the list by the new column after deleting the rows with no data. Hope that helps, Adam |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
Thanks for your help guys!! The sorting and the codes worked.
Noir |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|