title: How to get my code to run at any worksheet
body: <p>I am new to VBA so please be patient as this all is new to me :)
  Below code works great. It will unmerge cells if merged through column A of active worksheet and fill with duplicates. It's placed in module 17 for worksheet &quot;Paste DATA&quot;. I would like to run this code on any worksheet if need. For example if for data inside in worksheet &quot; Paste Additional Data &quot; need to use this code i could use it by changing target worksheet name inside code. Same with range - change range by adjusting manually inside code.</p>
  <pre><code>Sub Unmerge_Cells_test()
  
  Application.ScreenUpdating = False
      Lr = Cells(Rows.Count, 1).End(xlUp).Row
          Cells(Lr, 1).Select
              Lr = Lr + Selection.Cells.Count - 1
              
  Range(&quot;A2:A&quot; &amp; Lr).UnMerge
      For R = 3 To Lr
          If Cells(R, 1) = &quot;&quot; Then Cells(R, 1) = Cells(R - 1, 1)
  Next R
  
  End Sub
  
  </code></pre>