Notifications
Clear all

Range de planilhas diferentes

2 Posts
2 Usuários
0 Reactions
996 Visualizações
(@alanisfcsm)
Posts: 0
Trusted Member
Topic starter
 

Boa tarde.
Tenho duas planilhas "A" e "B"
Como defino Range das duas no código Abaixo?
ex:
na planilha "A" vou usar L19, L22, L25, L28
na planilha "b" vou usar BA19, BA22, BA25, BA28

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCells As Range
    
    ' The variable KeyCells contains the cells that will
    ' cause an alert when they are changed.
    Set KeyCells = Range("L19,L22,L25,L28")
    
    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
           Is Nothing Then

OCULTAR_REEXIBIR_LINHA02_B
        ' Display a message when one of the designated cells has been
        ' changed.
        ' Place your code here.
        ' MsgBox "Cell " & Target.Address & " has changed."
       
    End If
End Sub
 
Postado : 13/04/2016 2:04 pm
Fernando Fernandes
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

o Evento ;
Private Sub Worksheet_Change(ByVal Target As Range)
corresponde a planilha ativa que estiver utilizando, então se esta rotina está na planilha "A" copie e cole na planilha "B" e troque pelos ranges que pretende.

[]s

Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel

 
Postado : 13/04/2016 7:15 pm