SHARE
TWEET

Untitled

a guest Jan 12th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub FindReplaceAll()
  2. 'PURPOSE: Find & Replace text/values throughout entire workbook
  3.  
  4. Dim sht As Worksheet
  5. Dim fnd As Variant
  6. Dim rplc As Variant
  7. Dim p As Integer
  8. Dim q As Integer
  9. p = 3
  10. q = p + 1
  11. fnd = "$3"
  12. rplc = "$" & q
  13.  
  14. For Each sht In ActiveWorkbook.Worksheets
  15.   sht.Cells.Replace what:=fnd, Replacement:=rplc, _
  16.     LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
  17.     SearchFormat:=False, ReplaceFormat:=False
  18. Next sht
  19. p=q
  20. End Sub
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top