Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
delete empty rows | Excel Discussion (Misc queries) | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete empty rows | Excel Programming |