Hi, I want to delete the empty columns in my excel workbook, so i have found the coding in internet as follow, but i have 2 worksheets need to do the same macro
how can i add one more worksheets in the coding below
Dim col As Long
With Worksheets("sheet1").UsedRange
For col = .Columns.Count To 1 Step -1
If WorksheetFunction.CountA(.Columns(col)) = 0 Then
.Columns(col).EntireColumn.Delete
End If
Next
End With
how can i add one more worksheets in the coding below
Dim col As Long
With Worksheets("sheet1").UsedRange
For col = .Columns.Count To 1 Step -1
If WorksheetFunction.CountA(.Columns(col)) = 0 Then
.Columns(col).EntireColumn.Delete
End If
Next
End With