title: Trying to fill a colored line above filled in cells
body: <p><a href="https://i.stack.imgur.com/QQgiJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QQgiJ.png" alt="No Colored Rows" /></a><a href="https://i.stack.imgur.com/PiVZA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PiVZA.png" alt="With Colored Rows" /></a>
  My code is to fill color into rows above filled in rows.
  There is 2 rows above the text it's the bottom row of the 2 needs to fill in color?
  They should be linked to the ranges shown in the Sub above the Function
  What I can't really understand that it seemed to work the other day but now it`s stopped working?
  I think the sub is right just the Function seems to be failing??
  Not sure how to link the 2 together?</p>
  <pre><code>   Private Sub Fill_Color_Click()
     Dim Com As ComboBox
     Dim ws As Worksheet
  
     Set Com = Me.Fill_Color
  
     With ws
     
      Select Case Com.Value
          Case (&quot;Fill Color 1 Page Job Card&quot;)
              Color .Range(&quot;A13:Q61&quot;)
  
          Case (&quot;Fill Color 2 Page Job Card&quot;)
              Color .Range(&quot;A13:Q61&quot;)
              Color .Range(&quot;A66:Q120&quot;)
     
          Case (&quot;Fill Color 3 Page Job Card&quot;)
               Color .Range(&quot;A13:Q61&quot;)
              Color .Range(&quot;A66:Q122&quot;)
              Color .Range(&quot;A127:Q178&quot;)
              
          Case (&quot;Fill Color 4 Page Job Card&quot;)
              Color .Range(&quot;A13:Q61&quot;)
              Color .Range(&quot;A66:Q122&quot;)
              Color .Range(&quot;A127:Q183&quot;)
              Color .Range(&quot;A188:Q244&quot;)
  
          Case (&quot;Fill Color 5 Page Job Card&quot;)
              Color .Range(&quot;A13:Q61&quot;)
              Color .Range(&quot;A66:Q122&quot;)
              Color .Range(&quot;A127:Q183&quot;)
              Color .Range(&quot;A188:Q244&quot;)
              Color .Range(&quot;A249:Q299&quot;)
      End Select
      
  End With
  
  
  End Sub
  
  Function Color(rng As Range)
  
  Dim row As Range
  Dim sheet As Worksheet
  Set ws = ThisWorkbook.Sheets(&quot;Job Card Master&quot;)
  Dim EmptyRowNum As Integer
  
  For i = 1 To rng.Rows.Count
  
      Set row = rng.Rows(i)
      If WorksheetFunction.CountA(row) = 0 Then
          EmptyRowNum = EmptyRowNum + 1
      End If
      If EmptyRowNum = 2 Then
          EmptyRowNum = 0
          row.Interior.ColorIndex = 4
      End If
  
  Next i
  
  End Function
         
  </code></pre>