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


Trying to write a macro that will read each row and if there is no dat
- delete it. Thought I could use the EntireRow.delete but not havin
any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christia

--
christia
-----------------------------------------------------------------------
christian's Profile: http://www.excelforum.com/member.php...fo&userid=1436
View this thread: http://www.excelforum.com/showthread.php?threadid=26175

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Delete Empty Rows

Hi Christian,

For rows with blanks in column A, Try:

Range("A1:A100").SpecialCells(xlCellTypeBlanks). _
EntireRow.Delete

Change the range to suit.

---
Regards,
Norman



"christian" wrote in message
...

Trying to write a macro that will read each row and if there is no data
- delete it. Thought I could use the EntireRow.delete but not having
any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christian


--
christian
------------------------------------------------------------------------
christian's Profile:
http://www.excelforum.com/member.php...o&userid=14361
View this thread: http://www.excelforum.com/showthread...hreadid=261759



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete Empty Rows

Hi Christian

Do you want to check one column or more ?
Post back if you want to check more columns

If you use Norman's example add the following line

On Error Resume Next 'In case there are no blank rows
Range("A1:A100").SpecialCells(xlCellTypeBlanks).En tireRow.Delete
On Error GoTo 0

If you do this for a whole column be carfull with the SpecialCells limit
http://support.microsoft.com/default...b;en-us;832293

David have a example om his site to avoid problems
http://www.mvps.org/dmcritchie/excel/delempty.htm

The sub is named del_COLA_empty()



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Norman Jones" wrote in message ...
Hi Christian,

For rows with blanks in column A, Try:

Range("A1:A100").SpecialCells(xlCellTypeBlanks). _
EntireRow.Delete

Change the range to suit.

---
Regards,
Norman



"christian" wrote in message ...

Trying to write a macro that will read each row and if there is no data
- delete it. Thought I could use the EntireRow.delete but not having
any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christian


--
christian
------------------------------------------------------------------------
christian's Profile: http://www.excelforum.com/member.php...o&userid=14361
View this thread: http://www.excelforum.com/showthread...hreadid=261759





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Delete Empty Rows

Hi
see:
http://www.cpearson.com/excel/deleti...eleteBlankRows

--
Regards
Frank Kabel
Frankfurt, Germany


christian wrote:
Trying to write a macro that will read each row and if there is no
data - delete it. Thought I could use the EntireRow.delete but not
having any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christian

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete Empty Rows

lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 1 step -1
if Application.CountA(rows(i)) = 0 then
rows(i).Delete
end if
Next

--
Regards,
Tom Ogilvy

"christian" wrote in message
...

Trying to write a macro that will read each row and if there is no data
- delete it. Thought I could use the EntireRow.delete but not having
any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christian


--
christian
------------------------------------------------------------------------
christian's Profile:

http://www.excelforum.com/member.php...o&userid=14361
View this thread: http://www.excelforum.com/showthread...hreadid=261759





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
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
delete empty rows aditya Excel Discussion (Misc queries) 1 June 3rd 09 12:58 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
Delete empty rows ian123[_15_] Excel Programming 1 December 14th 03 02:35 PM


All times are GMT +1. The time now is 07:16 AM.

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

About Us

"It's about Microsoft Excel"