Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Draft saved
Draft discarded
Cancel
7
  • 1
    Well, this begs the question why there is not one global function that all the pages can use? Why copy code over and over? Anyway, I would do a shift-ctrl-f (that's a global find). Type in "Function FExample", and now you have a "list" of all locations of that function, and thus can work your way though that list - and use a "paste" into that routine. But really, why not have ONE function that all pages call? Commented Jan 23, 2025 at 20:17
  • @AlbertD.Kallal Yes, a refactoring to a new call to a common function as you mentioned. We’ve got hundreds of occurrences of the function so I was hoping for an automated way to replace them all. Commented Jan 23, 2025 at 20:26
  • Well, the global shift-ctrl-f to find and search the whole project probably is a good start. I suppose you could consider a global find/replace, but that would assume an exact match. There can't be that many instances here - and the shift-ctrl-f to global find will produce a VERY nice "hit list" of results, and that list can be used to work your way though each instance...... Commented Jan 23, 2025 at 20:31
  • @AlbertD.Kallal Perhaps a global file find and replace using regex could replace the content of all text starting with "Private Function fExampleA() As Boolean" and ending with "End Function" with the new function code. Commented Jan 23, 2025 at 20:37
  • 1
    Hum, well, you could try pasting in the whole routine match - see if it works. I just think doing one by one would not take all that long "once" you have the search hit list. So, often people are not aware of the shift-ctrl-f for the global find (and/or replace). I think once you done the global find, then working though the hit-list is a better approach then actually using find + replace. Commented Jan 23, 2025 at 20:52

lang-vb

AltStyle によって変換されたページ (->オリジナル) /