S
SteveT
Hello,
I'm using JLGWhiz's solution in posting "Deleting Column Based On Header"
to delete columns other than those correctly titled. - Below -
It works Fine but only when run several times or repeated.
Can someone help me enhance to automatically loop until either desired # of
columns with data or until Column Headers indicated below all that left ?
Dim C As Range
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Set myRng = Range("A1", Cells(1, lc))
For Each C In myRng
If C <> "Doc. Date" And C <> "DocumentN" And C <> "Type" And C <>
"Reference" And C <> "LC amnt" Then
C.EntireColumn.Delete
End If
Next
Many Thanks / Happy Holidays
Steven
all left
I'm using JLGWhiz's solution in posting "Deleting Column Based On Header"
to delete columns other than those correctly titled. - Below -
It works Fine but only when run several times or repeated.
Can someone help me enhance to automatically loop until either desired # of
columns with data or until Column Headers indicated below all that left ?
Dim C As Range
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Set myRng = Range("A1", Cells(1, lc))
For Each C In myRng
If C <> "Doc. Date" And C <> "DocumentN" And C <> "Type" And C <>
"Reference" And C <> "LC amnt" Then
C.EntireColumn.Delete
End If
Next
Many Thanks / Happy Holidays
Steven
all left