title: Looping Through Sheets Not Working - Any Ideas?
body: <p>I'm newish to VBA and tried creating this code that loops through all the sheets in the WB and deletes any &quot;#Ref!&quot; in a specific range. The delete Ref part is working, but the code refuses to loop through the sheets, any idea why? Code below. I tried with and without the &quot;WS.Activate&quot; on the third line -- Thanks!</p>
  <p>P.s. Add to the puzzle this same code worked for my friend on his PC</p>
  <p><code>   Dim WS As Worksheet</code></p>
  <pre><code>For Each WS In ThisWorkbook.Worksheets
  WS.Activate
  For i = 1 to 10
  Dim FoundItems As Range
  On Error Resume Next
  Set FoundItems = Range (&quot;A2:D50&quot;).Find(&quot;#ref!&quot;)
  Debug.Print FoundItems.ClearContents
  Next i
  Next WS
  
  End Sub*
  </code></pre>
  <p>Even Simpler, this code isn't working either.</p>
  <pre><code>Dim WS As Worksheet
  For Each WS In ThisWorkbook.Worksheets
  WS.Activate
  Cells(2,3) = 5
  Next WS
  End Sub
  </code></pre>