LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting blank rows in a range or another fill approach

Use

ElseIf .Cells(Lrow, "A").Value = "" Then .Rows(Lrow).Delete


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



"BigDave" wrote in message
...

Alright - I've moved the formulas to a second sheet (that I'll later
hide) so that everything is nice and neat, starting in column A. The
formulas are only in cells A2:A21 for testing.


Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 2
EndRow = 21
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "a").Value) Then
'Do nothing, This avoid a error if there is a error in the cell

ElseIf IsText(.Cells(Lrow, "a").Value) Then .Rows(Lrow).Delete
'This will delete the row if the cell is empty

End If
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With


End Sub


Column A is filled with these formulas - *=IF(F2=" ","",Sheet2!$D$4)*.
When I run the code, I get nothing. Ideas?

Here is the other code -

Sub DeleteBlankRows()

End Sub
Dim rownum As Integer
rownum = 2

Do Until rownum = 21

cellloc = "A" & 2

Range(cellloc).Select
If Range(cellloc).Value = "" Then
Rows(rownum).Select
Selection.Delete Shift:=xlUp
Else
End If

rownum = rownum + 1
Loop

Range("A1").Select

End Sub


When I ran this code, it delted the columns between the first and next
cells with text, but none of the others (that contain forumlas). ???

Thanks


--
BigDave
------------------------------------------------------------------------
BigDave's Profile: http://www.excelforum.com/member.php...fo&userid=7741
View this thread: http://www.excelforum.com/showthread...hreadid=376074





 
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
How to fill in range of blank rows wth data fr last row previos ra Shinta Chen Excel Discussion (Misc queries) 1 September 11th 07 05:07 AM
MACRO HELP - deleting rows containing a range of blank cells DavidHawes Excel Discussion (Misc queries) 9 February 26th 07 03:40 PM
Deleting Blank Rows Reeni New Users to Excel 4 December 15th 05 01:56 AM
Deleting blank rows Michael Chang Excel Programming 2 January 21st 05 02:47 AM
Deleting rows without a fill Glenn Excel Programming 4 January 26th 04 02:14 AM


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