
Public Function LettCol(ByVal n As Long) As String
LettCol = Replace(Cells(1, n).Address(False, False), "1", "")
End Function
Sub elimina_colonne()
Dim X, C As Variant
C = Cells(1, Columns.Count).End(xlToLeft).Column
For X = C To 3 Step -1
If Not IsNumeric(Cells(1, X)) And Cells(1, X) <> "" Then
Columns(LettCol(X) & ":" & LettCol(X)).Delete
End If
Next
MsgBox "fatto"
End Sub |
Sub elimina_colonne()
NC = Cells(1, Columns.Count).End(xlToLeft).Column
scelta = "A" ' <<<<<<<< da modificare
For Col = NC To 1 Step -1
If Cells(1, Col) = scelta Then
Columns(Col).Delete
End If
Next
MsgBox "fatto"
End Sub |
