PDA

View Full Version : Asking for VBA help



daydream25
12-21-2010, 10:11 PM
Hi,

Does any kindness person can do me a favor?
Could you please show me a VBA code that can delete Rows which are enpty in clumn C in a booksheet. And, I wourld like this program check through the whole booksheet to take empty rows away.

thanks

Allen
worldahead09@gmail.com

Bob Phillips
12-22-2010, 01:25 AM
Const TestColumn As Long = 3 'column C
Dim sh As Worksheet
Dim rng As Range
Dim cRows As Long

For Each sh In ThisWorkbook.Worksheets

cRows = sh.Cells(sh.Rows.Count, TestColumn).End(xlUp).Row

On Error Resume Next
Set rng = sh.Columns(TestColumn).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rng Is Nothing Then

rng.Delete
End If
Next sh