Notifications
Clear all

Worksheet_BeforeDoubleClick

2 Posts
2 Usuários
0 Reactions
945 Visualizações
(@juauvitor)
Posts: 0
New Member
Topic starter
 

Boa tarde,

Preciso de uma ajudinha, Tenho no meu projeto o seguinte código:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If ActiveCell.Column <> 13 Then Exit Sub

ActiveCell.Value = "OK"
ActiveCell.Offset(1, 0).Select

End Sub

Ou seja, Quando eu dou um duplo clique do mouse em qualquer célula da coluna "M" (13), o texto "OK" aparece automaticamente.

O que eu não estou conseguindo fazer é colocar isso para funcionar para mais de uma coluna. por exemplo a 13, a 18 e a 23 por exemplo, que são diferentes.

Qualquer dica será bem vinda, grato. :ugeek:

 
Postado : 13/09/2016 12:00 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 


Entre outras alternativas:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If ActiveCell.Column = 13 Or ActiveCell.Column = 18 Or ActiveCell.Column = 23 Then
ActiveCell.Value = "OK"
ActiveCell.Offset(1, 0).Select
End If

End Sub

 
Postado : 13/09/2016 1:38 pm