Delete Blank Rows-I know I know its been asked a million>

Bigzippy

Board Regular
Joined
Jul 1, 2003
Messages
182
Sub DelBlankRows()

On Error Resume Next
range("B6:B194").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

End Sub

this does not work but it describes what im tring to do,m imust not del anything above row 6

Please help Lal
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
In Cell A1, I type ="", then I copy/pastespecial values.

In VBA Macros:
IsEmpty(Range("A1")) is False;
Range("A1") = "" is True.

In Cell A1, I type ="", then I delete A1:
IsEmpty(Range("A1")) is True;
Range("A1") = "" is True.

What is in the cells you are using copy/pastespecial values on?
Edit: and how are you doing this operation...by hand or in a macro?
Edit 2: SORRY - I think I missed page 2 and see you have answered all of this...ignore me. :LOL:
 
Upvote 0
OK, the problem is the + in the formula...

"=+IF(WEEKDAY(RC[-1],2)<6,RC[-1],"""")"

That is somehow telling excel that the contents of the cell is a number - even if no number is in it.

remove that +

"=IF(WEEKDAY(RC[-1],2)<6,RC[-1],"""")"
 
Upvote 0
hmm, maybe try changing the formula to put a space instead of a blank..
Code:
ActiveCell.Offset(-1, 1).FormulaR1C1 = "=+IF(WEEKDAY(RC[-1],2)<6,RC[-1],"" "")"
and then after the paste special values, use text - to columns to remove the spaces... was sucessfull testing that here..

Code:
    Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
        TextQualifier:=xlNone, ConsecutiveDelimiter:=True, Tab:=False, Semicolon _
        :=False, Comma:=False, Space:=True, Other:=False, FieldInfo:=Array(1, 1 _
        ), TrailingMinusNumbers:=True
 
Upvote 0

Forum statistics

Threads
1,215,845
Messages
6,127,259
Members
449,372
Latest member
charlottedv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top