title: invalid qualifier error in VBA while renaming with search criteria
body: <p>i am writing a code to rename the existing sheets as per search criteria.
  eg. if sheet1 in A:A range contains name "Demo" then rename it to "NewDemo"
  here is my code but i am getting invalid qualifier error.</p>
  
  <pre><code>Dim s As String
       Dim ws As Workbook
  
       s = ActiveWorkbook.Worksheets.Count                            'returns no of sheets in excel
       Set ftab = Range("A:A").Find("Summary Compensation Table")     'find key from 1st tab
       Set stab = Range("A:A").Find("Components of Pay")              'find key from 2st tab
       Set ttab = Range("A:A").Find("Target Bonus &amp; Most Recent Pay") 'find key from 3st tab
       Set fotab = Range("A:A").Find("Cash &amp; Equity Benchmarking")     'find key from 4st tab
       For Each ws In Worksheets
       s = ActiveWorkbook.Sheets(1).Activate
         If s.Contains(ftab) Then
         ActiveSheet.Name = "Summary Compensation Table"
       s = ActiveWorkbook.Sheets(2).Activate
         If s.Contains(stab) Then
         ActiveSheet.Name = "Components of Pay"
       s = ActiveWorkbook.Sheets(3).Activate
         If s.Contains(ttab) Then
         ActiveSheet.Name = "Target Bonus &amp; Most Recent Pay"
       s = ActiveWorkbook.Sheets(4).Activate
         If s.Contains(fotab) Then
         ActiveSheet.Name = "Cash &amp; Equity Benchmarking"
  
         Else
         MsgBox "Not Found"
         MsgBox ws.Name
       Next ws
  </code></pre>