Question : excel - If cell is blank, delete entire column

Hi,
I have a spreadsheet in excel.

If any cell in row 2 = 0 I want to delete that entire columnn.

Is this possible?
Sm17ch

Answer : excel - If cell is blank, delete entire column

hth

Dave
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Sub KillTwo()
Dim rng1 As Range
Dim lngRow As Long
Application.ScreenUpdating = False
Set rng1 = Intersect(ActiveSheet.UsedRange, Rows(2))
For lngRow = rng1.Columns.Count To 1 Step -1
If rng1.Cells(lngRow).Value = "0" Then rng1.Cells(lngRow).EntireColumn.Delete
Next lngRow
Application.ScreenUpdating = True
End Sub
Random Solutions  
 
programming4us programming4us