VBA Changing tab color

I am trying to write a code in VBA to change the tab color based on cell value. The code I have now works when I manually input the key word. However, the cell is auto-populated by a VLOOKUP and when it auto-populates the tab does not change color. I need advice on how to change the VBA code to accommodate the VLOOKUP 

 

 

Current Code:

Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = “$A$6” Then

        Select Case Target.Value

        Case “Active”

            Me.Tab.Color = vbGreen

        Case “Hold”

            Me.Tab.Color = vbYellow

        Case “Closed”

            Me.Tab.Color = vbBlue

        End Select

    End If

End Sub

By: Hannah

2,158 thoughts on “VBA Changing tab color

  1. Aplicativo Series Da Tv

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

  2. Rubye Stenn

    I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to construct my own blog and would like to know where u got this from. kudos

  3. 출장

    Pretty nice post. I just stumbled upon your weblog and wished to say that I ave really enjoyed browsing your blog posts. In any case I all be subscribing to your feed and I hope you write again soon!

Comments are closed.