VBA_Excel

For para formatar células de um intervalo de linhas, com If

Sub Botão1_Clique()
    Dim i As Integer
    For i = 3 To 62
        If Cells(i, 15).Value = “x” Then ‘ Coluna O
            Cells(i, 6).Font.Bold = True ‘ Coluna F
            Cells(i, 6).Font.Color = vbRed
        Else
            Cells(i, 6).Font.Bold = False ‘ Remove negrito
            Cells(i, 6).Font.Color = vbBlack
        End If
    Next i
End Sub


Formatar células de um intervalo

Sub Botão1_Clique()
Range(“c1:c10”).Font.Size = 7
Range(“c1:c10”).Interior.Color = vbWhite
Range(“c1:c10”).Font.Color = vbBlack
Range(“c1:c10”).Font.Bold = False
End Sub