Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. For Each Cell in newRange
  2. Cell.EntireColumn.Delete
  3.  
  4. Dim Cell As Range
  5. Dim Source As Range
  6. Set Source = Range(Cells(1, 1), Cells(1, Columns.Count))
  7. Dim strWords As Variant
  8. strWords = Array("Number", "First Name")
  9.  
  10. For Each Cell In Source
  11. For i = UBound(strWords) To LBound(strWords) Step -1
  12. If InStr(UCase(Cell), UCase(strWords(i))) > 0 Then
  13. Cell.EntireColumn.Delete
  14. Next i
  15. Next
  16.  
  17. End Sub
  18.  
  19. If InStr(UCase(Cell), UCase(strWords(i))) > 0 Then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement