Thursday, 15 March 2012

Hi, I have blocks of blank rows in my excel sheet, to remove them i have used this code but it skips blank rows in between -


 For  n = 1 to 99 if ismptpty (cells (n, 1)) then cell (n, 1 ). Interstate Delete Finish Next n  

This is the code I have used, but it leaves empty rows, I have an idea to find out about reverse loops, but it's self have not done it. Please help me I am a newbie in excel.

Thanks

Use this:

  Range set Rng = Sheet1.Range ("B1: B99") rng.SpecialCells (xlCellTypeBlanks) .Cells.EntireRow.Delete End Sub  

No comments:

Post a Comment