Olá, Pessoal!Por gentileza, gostaria da ajuda de vocês.Preciso aplicar esse código para dois shapes na mesma aba, porém ele não aceita mesmo inserindo as variáveis novas.Realizei algumas tentativas, porém somente uma atualiza.
Option Explicit
Public Sub PreencherCorFormas5()
Dim strNomeForma As String
Dim rngCelulas As Range
Dim lngCor As Long, lngRed As Long, lngGreen As Long, lngBlue As Long
With wshPrincipal
For Each rngCelulas In .ListObjects("tbTipo").ListColumns("Tipo Cor").DataBodyRange
strNomeForma = CStr(rngCelulas.Offset(, -1).Value2)
lngCor = .Range(rngCelulas.Value).Interior.Color
lngRed = lngCor Mod 256
lngGreen = (lngCor \ 256) Mod 256
lngBlue = (lngCor \ 65536) Mod 256
.Shapes.Range(strNomeForma).Fill.ForeColor.RGB = RGB(lngRed, lngGreen, lngBlue)
Next rngCelulas
End With
End Sub