Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default deleting rows in excel


I have an excel sheet that looks like this:

jan 45.300
feb 56.987
mar 65.743

jan 43.256
feb 41.678


jan 78.934
feb 67.214
mar 56.983

etc...

So it's usuallly a set of data then an empty row and then again a se
of data. Problem is that I sometimes have 2 empty rows. How can
delete this "extra" row

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default deleting rows in excel

try this where 20 is the last row

Sub deleteextrarow()
With Columns(1)
For r = 20 To 2 Step -1
With .Cells(r, 1)
If .Offset(0) = "" And .Offset(1) = "" _
Then .EntireRow.Delete
End With
Next
End With
End Sub

--
Don Guillett
SalesAid Software

"nick80" wrote in message
...

I have an excel sheet that looks like this:

jan 45.300
feb 56.987
mar 65.743

jan 43.256
feb 41.678


jan 78.934
feb 67.214
mar 56.983

etc...

So it's usuallly a set of data then an empty row and then again a set
of data. Problem is that I sometimes have 2 empty rows. How can I
delete this "extra" row?


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default deleting rows in excel

Use an empty column to the right of your data, say, column
C
Assuming your data starts in row 1 column a, in the first
cell type: =IF(AND(A1="","A2"=""),"Delete Me","") copy
this formula in each cell down to the end of the data.
Next apply the AutoFilter (Data/Filter/AutoFilter) and
filter column C to show "Delete Me" items. Right click on
the first row header of the filtered list and then press
Shift + End + down arrow to select the entire list. Right
click/delete row

-----Original Message-----

I have an excel sheet that looks like this:

jan 45.300
feb 56.987
mar 65.743

jan 43.256
feb 41.678


jan 78.934
feb 67.214
mar 56.983

etc...

So it's usuallly a set of data then an empty row and then

again a set
of data. Problem is that I sometimes have 2 empty rows.

How can I
delete this "extra" row?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

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
Inserting and Deleting Rows in Excel ttonkel Excel Worksheet Functions 2 March 7th 09 03:06 PM
Deleting filtered rows in Excel RajeevAsthana Excel Discussion (Misc queries) 1 December 6th 07 03:37 PM
Deleting filtered rows in Excel RajeevAsthana Excel Discussion (Misc queries) 1 December 5th 07 03:20 PM
Deleting Rows in MS Excel MacK Excel Discussion (Misc queries) 9 July 30th 07 06:24 PM
Deleting rows in a macro in Excel THEFALLGUY Excel Discussion (Misc queries) 4 December 23rd 05 01:59 PM


All times are GMT +1. The time now is 08:52 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"