Unir dos codigos Private Sub Worksheet_Change(ByVal Target As Range)
Tengo los siguientes dos códigos
'Por. Dante Amor
'TRANSFERENCIA
If Not Intersect(Target, Range("G:H")) Is Nothing Then
If Target.Count > 1 Then Exit Sub
If UCase(Cells(Target.Row, "G")) = "PAGO" And _
UCase(Cells(Target.Row, "H")) = "TRANSFERENCIA" And _
UCase(Cells(Target.Row, "I")) = "SI" Then
'
Application.ScreenUpdating = False
Set l2 = Workbooks("FACT CANC DICIEMBRE 2015.xlsm")
Set h2 = l2.Sheets("TRANSFERENCIA")
u = h2.Range("D" & Rows.Count).End(xlUp).Row + 1
Range("B" & Target.Row & ":F" & Target.Row).Copy
h2.Range("D" & u).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End If'Por.Dante Amor
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("C:D")) Is Nothing Then
If Cells(Target.Row, "C") <> "" And Cells(Target.Row, "D") <> "" Then
Set r = Columns("C")
Set b = r.Find(Cells(Target.Row, "C"), lookat:=xlWhole)
If Not b Is Nothing Then
ncell = b.Address
Do
If b.Row <> Target.Row Then
If Cells(b.Row, "D") = Cells(Target.Row, "D") Then
MsgBox "Factura y proveedor repetidos, en la fila " & b.Row, vbExclamation
Target.Select
Exit Do
End IfLos 2 codigos funcionan bien por separado, pero necesito unirlos
@aprendemos
Respuesta de Dante Amor
1