Descricao: |
Saberexcel - o site de quem precisa Aprender Macros Microsoft Excel VBA
 Esse procedimento do Aplicativo Microsoft Excel VBA(Visual Basic Application), insere determinada cor em determinada coluna ao dar um duplo clique na célula, insere a letra 'x' com cor determinante, ao clicar novamente na célula formatada, que poderá ser um status, limpa novamente a cor e o 'x' inserido.
Private Sub Worksheet_BeforeDoubleClick (ByVal Target As Range, Cancel As Boolean)
If Target.Column = 2 Then If Cells(Target.Row, 2).Interior.ColorIndex <> 3 Then Cells(Target.Row, 2).Interior.ColorIndex = 3 Cells(Target.Row, 2).Value = "x" Else Cells(Target.Row, 2).Interior.ColorIndex = 2 Cells(Target.Row, 2).Value = "" End If End If
If Target.Column = 3 Then If Cells(Target.Row, 3).Interior.ColorIndex <> 6 Then Cells(Target.Row, 3).Interior.ColorIndex = 6 Cells(Target.Row, 3).Value = "x" Else Cells(Target.Row, 3).Interior.ColorIndex = 2 Cells(Target.Row, 3).Value = "" End If End If
If Target.Column = 4 Then If Cells(Target.Row, 4).Interior.ColorIndex <> 4 Then Cells(Target.Row, 4).Interior.ColorIndex = 4 Cells(Target.Row, 4).Value = "x" Else Cells(Target.Row, 4).Interior.ColorIndex = 2 Cells(Target.Row, 4).Value = "" End If End If
End Sub
 Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel

Publicidade Compre com segurança, garantia e ótimos preços

|