thecueball
Board Regular
- Joined
- Nov 11, 2004
- Messages
- 66
Hi,
I use the following macro to delete any blank rows in my worksheets, can it be changed to use it for deleteing any blank columns within my data range???
If it can't, has anyone got a macro that can do the above?
TIA
Sub DeleteRowsIfZero()
FinalRow = Range("D65536").End(xlUp).Row
For x = FinalRow To 1 Step -1
If WorksheetFunction.CountA(Range(Cells(x, "A"), Cells(x, "F"))) = 0 Then
Rows(x).Delete Shift:=xlUp
End If
Next x
End Sub
I use the following macro to delete any blank rows in my worksheets, can it be changed to use it for deleteing any blank columns within my data range???
If it can't, has anyone got a macro that can do the above?
TIA
Sub DeleteRowsIfZero()
FinalRow = Range("D65536").End(xlUp).Row
For x = FinalRow To 1 Step -1
If WorksheetFunction.CountA(Range(Cells(x, "A"), Cells(x, "F"))) = 0 Then
Rows(x).Delete Shift:=xlUp
End If
Next x
End Sub