Try this with a fixed column.
Note the lines to make it a selectable column if you wanted.
Public Sub DeleteColOnWord()
Dim coltocheck As Range
Dim thename As String
On Error GoTo endit
Set coltocheck = Range("D
")
' Set coltocheck = Application.InputBox(Prompt:= _
' "Select A Column", Type:=8)
thename = InputBox("enter a name")
For Each i In coltocheck
If i.Value = thename Then _
i.EntireColumn.Delete
Next i
endit:
End Sub
Gord
- Show quoted text -