I need to improve a portion of my macro that is supposed to delete two columns. When my estimating program exports to Excel there is a column named "Digitizer" and the next column does not have a header. Digitizer is not always in the same column. I need to find "Digitizer"and delete two columns. I thought I had it with this code, but today I had a case where there was some data in the column and I only deleted some cells, not the entire column.
Dim rng1 As Range
Set rng1 = Range(Range("A1:Z1").Find("Digitizer").Offset(0, 1), Range("A1:Z1").Find("Digitizer").End(xlDown))
rng1.Select
Selection.Delete Shift:=xlToLeft
Dim rng1 As Range
Set rng1 = Range(Range("A1:Z1").Find("Digitizer").Offset(0, 1), Range("A1:Z1").Find("Digitizer").End(xlDown))
rng1.Select
Selection.Delete Shift:=xlToLeft