PC Review


Reply
Thread Tools Rate Thread

Deleting/removing unused rows in a worksheet

 
 
Tom
Guest
Posts: n/a
 
      25th Nov 2009
Excel 2007 all MS updates
Is it possible to delete rows without ANY data automatically? Currently, I
have a 2000+ row spreadsheet that has 250+ blank rows. Instead of doing this
manually, how can the removal or deletion (squishing!) of the blank rows be
done? For example, say I have a spreadsheet with data in rows 1, 2,4,6,8 and
12. All I really need are THESE rows with data. I want to squish,
eliminate, delete the rows in 3,5,7,9,10,11.
How can I do this by 'highlighting' or whatever the entire set (rows 1-12
above) and then performing an "delete empty row" process?
TIA
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      25th Nov 2009
If you are interested in macros try out the below macro. If you are new to
macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()>


Sub DeleteRows()
Dim lngRow As Long, lngLastRow As Long
lngLastRow = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlRows).Row
For lngRow = lngLastRow To 1 Step -1
If WorksheetFunction.CountBlank(Rows(lngRow)) = Columns.Count _
Then Rows(lngRow).Delete
Next
End Sub

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


"Tom" wrote:

> Excel 2007 all MS updates
> Is it possible to delete rows without ANY data automatically? Currently, I
> have a 2000+ row spreadsheet that has 250+ blank rows. Instead of doing this
> manually, how can the removal or deletion (squishing!) of the blank rows be
> done? For example, say I have a spreadsheet with data in rows 1, 2,4,6,8 and
> 12. All I really need are THESE rows with data. I want to squish,
> eliminate, delete the rows in 3,5,7,9,10,11.
> How can I do this by 'highlighting' or whatever the entire set (rows 1-12
> above) and then performing an "delete empty row" process?
> TIA

 
Reply With Quote
 
Luke M
Guest
Posts: n/a
 
      25th Nov 2009
You can install and run this short macro. (Bring up VBE using Alt+F11, Insert
- Module, paste this in)

Sub Cleanup()
For i = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row _
To 1 Step -1
If WorksheetFunction.CountA(Range(Cells(i, 1), Cells(i, 256))) = 0 Then
ActiveSheet.Rows(i).Delete
End If
Next
End Sub

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Tom" wrote:

> Excel 2007 all MS updates
> Is it possible to delete rows without ANY data automatically? Currently, I
> have a 2000+ row spreadsheet that has 250+ blank rows. Instead of doing this
> manually, how can the removal or deletion (squishing!) of the blank rows be
> done? For example, say I have a spreadsheet with data in rows 1, 2,4,6,8 and
> 12. All I really need are THESE rows with data. I want to squish,
> eliminate, delete the rows in 3,5,7,9,10,11.
> How can I do this by 'highlighting' or whatever the entire set (rows 1-12
> above) and then performing an "delete empty row" process?
> TIA

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      25th Nov 2009
Select a column and F5>Special>Blanks>OK

Edit>Delete>Entire Row.

Record a macro whilst doing this.


Gord Dibben MS Excel MVP

On Wed, 25 Nov 2009 05:20:01 -0800, Tom <(E-Mail Removed)>
wrote:

>Excel 2007 all MS updates
>Is it possible to delete rows without ANY data automatically? Currently, I
>have a 2000+ row spreadsheet that has 250+ blank rows. Instead of doing this
>manually, how can the removal or deletion (squishing!) of the blank rows be
>done? For example, say I have a spreadsheet with data in rows 1, 2,4,6,8 and
>12. All I really need are THESE rows with data. I want to squish,
>eliminate, delete the rows in 3,5,7,9,10,11.
>How can I do this by 'highlighting' or whatever the entire set (rows 1-12
>above) and then performing an "delete empty row" process?
>TIA


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Flicker while deleting rows in TablelayoutPanel Sujay Ghosh Microsoft Dot NET Framework Forms 0 10th Mar 2008 04:07 PM
deleting unused space at the end of a worksheet =?Utf-8?B?YmVja3l6?= Microsoft Excel Worksheet Functions 3 9th Oct 2006 08:21 PM
removing unused columns and rows WarrenC Microsoft Excel Discussion 1 10th Jul 2006 09:32 PM
removing or deleting unused addresses =?Utf-8?B?c2hhbm5vbmQxMw==?= Windows XP General 2 27th Dec 2004 08:51 AM
Removing unused or blank rows and columns =?Utf-8?B?TWFyayBG?= Microsoft Excel Misc 2 23rd Dec 2004 02:39 AM


Features
 

Advertising
 

Newsgroups
 


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