Hi,
I need to be able to delete multiple columns based on header content. I would like to incorporate a Msgbox where I can input the values to be found in the headers and then deleted (the whole column).
I have some code (thanks to the contribution of another board member on a different question) and it works great, except I want to incorporate a Msgbox that asks for the values I want to delete.
Currently the code will go thru and delete columns with "2010" in the header. I am not sure where/ how to code for the Msgbox especially for multiple values such as: "2006", "2007", "2008", "2009", and "2010".
Can someone help me with this?
Thanks in advance
I need to be able to delete multiple columns based on header content. I would like to incorporate a Msgbox where I can input the values to be found in the headers and then deleted (the whole column).
I have some code (thanks to the contribution of another board member on a different question) and it works great, except I want to incorporate a Msgbox that asks for the values I want to delete.
Code:
Sub data_shrnk()
Dim rng As Range
With Worksheets("Dump").Range("A1:CU1")
Set rng = Worksheets("Dump").Range("A1:CU1").Find(What:="2010", _
LookAt:=xlPart, MatchCase:=False)
Do While Not rng Is Nothing
rng.EntireColumn.Delete
Set rng = .FindNext
Loop
End With
Currently the code will go thru and delete columns with "2010" in the header. I am not sure where/ how to code for the Msgbox especially for multiple values such as: "2006", "2007", "2008", "2009", and "2010".
Can someone help me with this?
Thanks in advance