Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Dim sht As Worksheet
  2. Dim fndList As Variant
  3. Dim rplcList As Variant
  4. Dim x As Long
  5.  
  6. fndList = Array("10780", "10782", "10783", "10784", "10785", "10786", "10787", "10789", "10790", "10791", "10792", "10793", "10794", "10795", "10796", "10797", "10798", "10799", "10800", "10801", "10802", "10803", "10804", "10805", "10806")
  7. rplcList = Array("90310011", "90310012", "90310020", "90310023", "90310039", "90310044", "90310051", "90310054", "90310061", "90310066", "90310079", "90310096", "90310099", "90310100", "90310101", "90310113", "90310119", "90310143", "90310148", "90310150", "90310154", "90310159", "90310176", "90310177", "90310161")
  8.  
  9. 'Loop through each item in Array lists
  10. For x = LBound(fndList) To UBound(fndList)
  11. 'Loop through each worksheet in ActiveWorkbook
  12. For Each sht In ActiveWorkbook.Worksheets
  13. sht.Cells.Replace What:=fndList(x), Replacement:=rplcList(x), _
  14. LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
  15. SearchFormat:=False, ReplaceFormat:=False
  16. Next sht
  17. Next x
  18.  
  19. sht.Cells.Replace What:=fndList(x), Replacement:=rplcList(x), _
  20.  
  21. sht.Range("G:G").Replace What:=fndList(x), Replacement:=rplcList(x), _
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement