I have a report that I have to publish every week. I also use MS Excel 2010.
How do you delete columns with a value of 0 starting in row 2, also starting from column N (or anything after column 14)?
My report has a header but it will constantly change and I will continue to add columns after column N.
This is a code I found but it needs to be modified. Can you help?
Here SubDeleteColumnsWithValueOfzero()
'Range("a2:u20").Select
Dim lColumn As Long
Dim iCntr As Long
lColumn = 21
For iCntr = lColumnTo 1 Step -1
'starts on row 2
If Cells(2, iCntr) =0 Then
Columns(iCntr).DELETE
End If
Next
End Sub
How do you delete columns with a value of 0 starting in row 2, also starting from column N (or anything after column 14)?
My report has a header but it will constantly change and I will continue to add columns after column N.
This is a code I found but it needs to be modified. Can you help?
Here SubDeleteColumnsWithValueOfzero()
'Range("a2:u20").Select
Dim lColumn As Long
Dim iCntr As Long
lColumn = 21
For iCntr = lColumnTo 1 Step -1
'starts on row 2
If Cells(2, iCntr) =0 Then
Columns(iCntr).DELETE
End If
Next
End Sub