Guest User

Untitled

a guest
Jun 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Sub Findref()
  4. Dim regexref As RegExp
  5. Set regexref = New RegExp
  6. regexref.Global = True
  7. regexref.IgnoreCase = True
  8. regexref.Pattern = "#REF"
  9.  
  10. Dim regexfile As RegExp
  11. Set regexfile = New RegExp
  12. regexfile.Global = True
  13. regexfile.IgnoreCase = True
  14. regexfile.Pattern = "C:"
  15.  
  16. Dim x As Name
  17. For Each x In ActiveWorkbook.Names
  18. If regexref.Test(x.RefersTo) Or regexfile.Test(x.RefersTo) Then
  19. Debug.Print x.Name
  20. End If
  21. Next x
  22. End Sub
Add Comment
Please, Sign In to add comment