I have some VBA code that works really well at deleting any columns in a single worksheet where any columns are headed with a 'FALSE' value. However, when I repeat the code within the same sub to take effect on a different worksheet, I get a Compile Error alert (Duplicate Declaration in Current Scope). Can anyone advise how I could make the extract below work across multiple worksheets (i.e. both "Outcome Summary" sheet and "Method Statement Evaluation" sheets plus other sheets)? Also, please note that each sheet has a different number of columns within the lColumn range.
Sub DeleteColumns()
With Sheets("Outcome Summary")
.Select
Dim lColumn As Long
Dim iCntr As Long
lColumn = 108
For iCntr = lColumn To 1 Step -1
If Cells(1, iCntr) = False Then
Columns(iCntr).Delete
End If
Next
With Sheets("Method Statement Evaluation")
.Select
Dim lColumn As Long
Dim iCntr As Long
lColumn = 156
For iCntr = lColumn To 1 Step -1
If Cells(1, iCntr) = False Then
Columns(iCntr).Delete
End If
Next
End With
End Sub