title: VBA - Changing the colour of multiple worksheet tabs depending on a cell value
body: <p>I am trying to create a button that upon one click, will check a specific cell in 10 sheets of a workbook, and recolour the tabs depending on a cell value. </p>
  
  <p>For example, </p>
  
  <ul>
  <li>If cell E15 > 18, then the tab colour should turn green. </li>
  <li>If cell E15 &lt; 18, then the tab colour should turn red. </li>
  </ul>
  
  <p>All 10 tabs should be evaluated and recoloured upon a single button click. </p>
  
  <p>So far my macro looks like this, giving just three sheets for an example. It's very crude but I am very new to VBA (1 day). </p>
  
  <p>My main issue is that it works for the first tab, but then opens the second tab and says "Object Required"</p>
  
  <pre><code>Sub Update_Tab_Colour_One_Click()    
      Sheets(4).Activate    
      If Cells(13, 11).Value &gt; 18 Then
          With ActiveWorkbook.ActiveSheet.Tab
              .Color = vbGreen
          End With
      Else
          With ActiveWorbook.ActiveSheet.Tab
              .Color = vbRed
          End With
      End If    
  
      Sheets(5).Activate    
      If Cells(13, 11).Value &gt; 18 Then
          With ActiveWorkbook.ActiveSheet.Tab
              .Color = vbGreen
          End With
      Else
          With ActiveWorbook.ActiveSheet.Tab
              .Color = vbRed
          End With
      End If
  
      Sheets(6).Activate    
      If Cells(13, 11).Value &gt; 18 Then
          With ActiveWorkbook.ActiveSheet.Tab
              .Color = vbGreen
          End With
      Else
          With ActiveWorbook.ActiveSheet.Tab
              .Color = vbRed
          End With
      End If    
  End Sub
  </code></pre>