Sie sind auf Seite 1von 2

MACRO POR EVENTOS PARA BUSCAR UNA DATO Y COLOCA EN LA COLUMNA PALOMEADO LA PALABRA QUE UD ELIJA

Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address(False, False) = "L1" Then
If Target.Count > 1 Then Exit Sub
c = [K1]
Set col = Cells.Find("PALOMEADO", lookat:=xlWhole)
If Not col Is Nothing Then
wcol = col.Column
palo = InputBox("Escriba su palomeado")
End If
Set r = Range(c & "4:" & c & Range(c & Rows.Count).End(xlUp).Row)
Set b = r.Find(Target, LookIn:=xlFormulas, lookat:=xlPart)
r.Interior.ColorIndex = xlNone
If Not b Is Nothing Then
ncell = b.Address
Do
b.Select
If MsgBox("Es el dato " & b.Value, vbQuestion + vbYesNo) = vbYes Then
b.Interior.ColorIndex = Target.Interior.ColorIndex
'
Cells(b.Row, wcol) = palo
If MsgBox("Desea continuar", vbQuestion + vbYesNo) = vbNo Then
Exit Sub
End If

End If
Set b = r.FindNext(b)
Loop While Not b Is Nothing And b.Address <> ncell
MsgBox "Ya no hay ms coincidencias"
Else
MsgBox "No existen datos"
End If
End If
End Sub