#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Deleting blank rows

In an accounting software generated reports, there are alternate blank rows
between rows that contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
...................
...................

I need the blank rows removed for exporting this data into MS Access.
Presently I am doing this by deleting one by one and would love to learn any
short cut that is available in excel. I am using Excel 2007.

Thanks in advance.
rafeek.




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Deleting blank rows

On Sat, 27 Aug 2011 13:57:51 +0300, "Rafeek" wrote:

In an accounting software generated reports, there are alternate blank rows
between rows that contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
..................
..................

I need the blank rows removed for exporting this data into MS Access.
Presently I am doing this by deleting one by one and would love to learn any
short cut that is available in excel. I am using Excel 2007.

Thanks in advance.
rafeek.




For each row in a selected range, this macro will check the first cell in the row. If that cell is empty, it will delete the entire row. Empty means that the cell is truly empty. So if there is a <space or a null string or a formula that is returning a blank, these will not be deleted. This behavior can be changed, if necessary, so as to delete anything that appears blank.

Also, the selection of the range could be automated in a variety of ways.

To enter this Macro (Sub), <alt-F11 opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.

To use this Macro (Sub), first select the range to process. Then <alt-F8 opens the macro dialog box. Select the macro by name, and <RUN.

======================
Option Explicit
Sub DeleteBlankRows()
Dim rg As Range
Dim i As Long
Set rg = Selection
For i = rg.Rows.Count To 1 Step -1
If IsEmpty(rg(i, 1)) Then
rg(i, 1).EntireRow.Delete
End If
Next i
End Sub
========================
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,549
Default Deleting blank rows

You can also just sort the data.
Blank cells sort to the bottom.
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html
editorial review of special sort add-in (30 ways to sort)






"Rafeek"
wrote in message
...
In an accounting software generated reports, there are alternate blank rows between rows that
contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
..................
..................

I need the blank rows removed for exporting this data into MS Access. Presently I am doing this by
deleting one by one and would love to learn any short cut that is available in excel. I am using
Excel 2007.

Thanks in advance.
rafeek.






  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Deleting blank rows

Thank you, Ron.

"Ron Rosenfeld" wrote in message
...
On Sat, 27 Aug 2011 13:57:51 +0300, "Rafeek" wrote:

In an accounting software generated reports, there are alternate blank
rows
between rows that contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
..................
..................

I need the blank rows removed for exporting this data into MS Access.
Presently I am doing this by deleting one by one and would love to learn
any
short cut that is available in excel. I am using Excel 2007.

Thanks in advance.
rafeek.




For each row in a selected range, this macro will check the first cell in
the row. If that cell is empty, it will delete the entire row. Empty
means that the cell is truly empty. So if there is a <space or a null
string or a formula that is returning a blank, these will not be deleted.
This behavior can be changed, if necessary, so as to delete anything that
appears blank.

Also, the selection of the range could be automated in a variety of ways.

To enter this Macro (Sub), <alt-F11 opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.

To use this Macro (Sub), first select the range to process. Then <alt-F8
opens the macro dialog box. Select the macro by name, and <RUN.

======================
Option Explicit
Sub DeleteBlankRows()
Dim rg As Range
Dim i As Long
Set rg = Selection
For i = rg.Rows.Count To 1 Step -1
If IsEmpty(rg(i, 1)) Then
rg(i, 1).EntireRow.Delete
End If
Next i
End Sub
========================



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Deleting blank rows

Thank you, Jim.

"Jim Cone" wrote in message
...
You can also just sort the data.
Blank cells sort to the bottom.
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html
editorial review of special sort add-in (30 ways to sort)






"Rafeek"
wrote in message
...
In an accounting software generated reports, there are alternate blank
rows between rows that contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
..................
..................

I need the blank rows removed for exporting this data into MS Access.
Presently I am doing this by deleting one by one and would love to learn
any short cut that is available in excel. I am using Excel 2007.

Thanks in advance.
rafeek.










  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 86
Default Deleting blank rows

Without sorting..............select column A then
EditGotoSpecialBlanks

EditDeleteEntire Row.


Gord Dibben Microsoft Excel MVP

On Sat, 27 Aug 2011 17:07:33 +0300, "Rafeek"
wrote:

Thank you, Jim.

"Jim Cone" wrote in message
...
You can also just sort the data.
Blank cells sort to the bottom.
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html
editorial review of special sort add-in (30 ways to sort)






"Rafeek"
wrote in message
...
In an accounting software generated reports, there are alternate blank
rows between rows that contains data.

Row1: Data
Row2: Blank
Row3: Data
Row4: Blank
Row5: Data
..................
..................

I need the blank rows removed for exporting this data into MS Access.
Presently I am doing this by deleting one by one and would love to learn
any short cut that is available in excel. I am using Excel 2007.

Thanks in advance.
rafeek.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Deleting Blank Rows JCG Excel Worksheet Functions 3 February 22nd 10 04:53 PM
deleting blank rows KRK New Users to Excel 3 June 27th 09 12:51 PM
Deleting Blank Rows. GEM Excel Discussion (Misc queries) 3 April 15th 09 04:18 PM
Deleting blank rows Yvette Excel Worksheet Functions 3 June 9th 06 10:30 AM
Deleting Blank Rows Reeni New Users to Excel 4 December 15th 05 01:56 AM


All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"