title: VBA changes Interior Color to a random color not specified in code
body: <p>I have created a macro to color-coordinate sales transactions based on different criteria. The range is columns F:R, with an unknown number of transactions. I have been using AutoFilter to conditionally format the data. </p>
  
  <p>It first colors the entire row based on transaction Type (sale, void, authorization), and then colors the entire row based on the Response (approved, declined, etc). The last step is to color the actual Card Type (column I) for each of the corresponding transactions. I wanted the AMEX cells to be light teal, and the remaining card type (Discover, MC, and Visa) cells to be pink.</p>
  
  <p>When it colors the AMEX cells teal, it works perfectly. When it moves on to color the remaining card types, which should ALL be pink, I first see a flash of pink, and then they all become DARK TEAL. I have gone through my code repeatedly and cannot figure out why the cells for Discover, MC and Visa are flashing pink for a second, and when the macro has finished running, all the Discover, MC and Visa cells are dark teal. The color code/RGB code for the dark teal color is nowhere in the code... If someone could PLEASE help me, that would be incredible! I am truly stumped!</p>
  
  <p>NOTE: I hope my code isn't too messy. (For example, my named ranges got a little out of hand on this macro.) This is the first time I have posted a VBA question to a forum (or shown anyone my codes, for that matter). If you have any VBA advice, I would love to improve!!</p>
  
  <pre><code>Sub PayPalColor()
  ' PayPalColor Macro
  ' Color coordinate the PayPal Reports
  
  'Add filters
  Range("F1:R1").Select
  Selection.AutoFilter
  
  'Reset Used Range
  Application.ActiveSheet.UsedRange
  
  Dim LastestRow As Long
  LastestRow = Range("K" &amp; Rows.Count).End(xlUp).Row
  
  'Sort TYPE alphabetically
  Dim rRng As Range
  Set rRng = Range("$F$2:$Q$" &amp; LastestRow)
  rRng.Sort key1:=Range("G2"), order1:=xlAscending, _
  Header:=xlNo
  
  
  With ActiveSheet.Range("$F$2:$Q$" &amp; LastestRow)
  ' TYPE: AUTHORIZATION
  Dim FilteredRange1 As Range
  Dim rw1 As Range
  .AutoFilter Field:=2, Criteria1:="Authorization"
  
      Set FilteredRange1 = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw1 In FilteredRange1.Rows
          If rw1.Row &gt; FilteredRange1.Rows.Row Then
              'If visible cell, format row here
              With rw1.Interior
                  .Pattern = xlSolid
                  .PatternColorIndex = xlAutomatic
                  .Color = 12566463
                  .TintAndShade = 0
                  .PatternTintAndShade = 0
              End With
          End If
      Next
          ActiveSheet.ShowAllData
  
  ' TYPE: CREDIT
  Dim FilteredRange2 As Range
  Dim rw2 As Range
  .AutoFilter Field:=2, Criteria1:="Credit"
  
      Set FilteredRange2 = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw2 In FilteredRange2.Rows
          If rw2.Row &gt; FilteredRange2.Rows.Row Then
              'If visible cell, format row here
              With rw2.Interior
      .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 16752607
      .TintAndShade = 0
      .PatternTintAndShade = 0
              End With
          End If
      Next
          ActiveSheet.ShowAllData
  
  ' TYPE: DELAYED CAPTURE
  Dim FilteredRange3 As Range
  Dim rw3 As Range
  .AutoFilter Field:=2, Criteria1:="Delayed Capture"
  
      Set FilteredRange3 = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw3 In FilteredRange3.Rows
          If rw3.Row &gt; FilteredRange3.Rows.Row Then
              'If visible cell, format row here
              With rw3.Interior
      .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 16768121
      .TintAndShade = 0
      .PatternTintAndShade = 0
              End With
          End If
      Next
          ActiveSheet.ShowAllData
  
  ' TYPE: VOID
  Dim FilteredRange4 As Range
  Dim rw4 As Range
  .AutoFilter Field:=2, Criteria1:="Void"
  
      Set FilteredRange4 = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw4 In FilteredRange4.Rows
          If rw4.Row &gt; FilteredRange4.Rows.Row Then
              'If visible cell, format row here
              With rw4.Interior
      .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 15513599
      .TintAndShade = 0
      .PatternTintAndShade = 0
              End With
          End If
      Next
          ActiveSheet.ShowAllData
  End With
  
  
  'Sort RESPONSE alphabetically
  Dim rRng2 As Range
  Set rRng2 = Range("$F$2:$Q$" &amp; LastestRow)
  rRng2.Sort key1:=Range("L2"), order1:=xlAscending, _
  Header:=xlNo
  
  
  With ActiveSheet.Range("$F$2:$Q$" &amp; LastestRow)
  ' RESPONSE: DECLINED
  Dim FilteredRange5 As Range
  Dim rw5 As Range
  .AutoFilter Field:=7, Criteria1:="Declined"
  
      Set FilteredRange5 = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw5 In FilteredRange5.Rows
          If rw5.Row &gt; FilteredRange5.Rows.Row Then
              'If visible cell, format row here
              With rw5.Interior
    .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 192
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
  With .Font
      .ThemeColor = xlThemeColorDark1
      .TintAndShade = 0
  End With
          End If
      Next
          ActiveSheet.ShowAllData
  
  'RESPONSE: INVALID EXP
  Dim FilteredRange5a As Range
  Dim rw5a As Range
  .AutoFilter Field:=7, Criteria1:="Invalid Exp"
  
      Set FilteredRange5a = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw5a In FilteredRange5a.Rows
          If rw5a.Row &gt; FilteredRange5a.Rows.Row Then
              'If visible cell, format row here
              With rw5a.Interior
    .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 192
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
  With .Font
      .ThemeColor = xlThemeColorDark1
      .TintAndShade = 0
  End With
          End If
      Next
          ActiveSheet.ShowAllData
  
  ' RESPONSE: CREDIT ERROR
  Dim FilteredRange5b As Range
  Dim rw5b As Range
  .AutoFilter Field:=7, Criteria1:="Credit Error"
  
      Set FilteredRange5b = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
      For Each rw5b In FilteredRange5b.Rows
          If rw5b.Row &gt; FilteredRange5b.Rows.Row Then
              'If visible cell, format row here
              With rw5b.Interior
    .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .Color = 192
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
  With .Font
      .ThemeColor = xlThemeColorDark1
      .TintAndShade = 0
  End With
          End If
      Next
          ActiveSheet.ShowAllData
  End With
  
  'clear background for card type column
  Range("I2").Select
  Range(Selection, Selection.End(xlDown)).Select
  With Selection.Interior
      .Pattern = xlNone
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
  
  'Sort CARD TYPE alphabetically
  Dim rRng3 As Range
  Set rRng3 = Range("$F$2:$Q$" &amp; LastestRow)
  rRng3.Sort key1:=Range("I2"), order1:=xlAscending, _
  Header:=xlNo
  
  
  With ActiveSheet.Range("I2:$I$" &amp; LastestRow)
  ' CARD TYPE: AMEX
  Dim FilteredRange6 As Range
  Dim rw6 As Range
  .AutoFilter Field:=4, Criteria1:="AMEX"
  
  Range("I2").Select
  Range(Selection, Selection.End(xlDown)).Select
  With Selection.Interior
      .Pattern = xlSolid
      .PatternColorIndex = xlAutomatic
      .ThemeColor = xlThemeColorAccent5
      .TintAndShade = 0.399975585192419
      .PatternTintAndShade = 0
  End With
      With Selection.Font
      .ThemeColor = xlThemeColorLight1
      .TintAndShade = 0
  End With
  ActiveSheet.ShowAllData
  
  ' CARD TYPE: Discover
  Dim FilteredRange111 As Range
  Dim rw111 As Range
  .AutoFilter Field:=4, Criteria1:="Discover"
  
  Range("I2").Select
  Range(Selection, Selection.End(xlDown)).Select
  With Selection.Interior
      .Pattern = xlSolid
      .Color = RGB(255, 51, 204)
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
      With Selection.Font
      .ThemeColor = xlThemeColorLight1
      .TintAndShade = 0
  End With
          ActiveSheet.ShowAllData
  
  ' CARD TYPE: MC
  Dim FilteredRange121 As Range
  Dim rw121 As Range
  .AutoFilter Field:=4, Criteria1:="MC"
  
  Range("I2").Select
  Range(Selection, Selection.End(xlDown)).Select
  With Selection.Interior
      .Pattern = xlSolid
      .Color = RGB(255, 51, 204)
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
      With Selection.Font
      .ThemeColor = xlThemeColorLight1
      .TintAndShade = 0
  End With
          ActiveSheet.ShowAllData
  
  ' CARD TYPE: Visa
  Dim FilteredRange122 As Range
  Dim rw122 As Range
  .AutoFilter Field:=4, Criteria1:="Visa"
  
  Range("I2").Select
  Range(Selection, Selection.End(xlDown)).Select
  With Selection.Interior
      .Pattern = xlSolid
      .Color = RGB(255, 51, 204)
      .TintAndShade = 0
      .PatternTintAndShade = 0
  End With
      With Selection.Font
      .ThemeColor = xlThemeColorLight1
      .TintAndShade = 0
  End With
          ActiveSheet.ShowAllData
  
  Range("F2").Select
  
  End With
  End Sub
  </code></pre>