title: Run Macro for any Active or Open Workbook?
body: <p>So I've created a simple Macro to:</p>
  
  <ul>
  <li>un-hide a worksheet.</li>
  <li>find and replace text.</li>
  <li>re-hide the worksheet.</li>
  </ul>
  
  <p>I have this macro working, but can only get it to work when I embed the macro code into a worksheet.</p>
  
  <p>Here is the code;</p>
  
  <pre><code>Sub UpdateChartParams()
  
  Dim Chart_Parameters As Worksheet
  
  Sheets("Chart_Parameters").Visible = True
  
  Sheets("Chart_Parameters").Select
  Cells.Replace What:="testtext", Replacement:="newtext", LookAt:=xlPart, _
  SearchOrder:=xlByRows, MatchCase:=False
  
  Sheets("Chart_Parameters").Visible = False
  
  End Sub
  </code></pre>
  
  <p>What I need to do is run this file against any open workbooks if possible.</p>