H o l a:
Te anexo la macro
Sub ActualizarMateriales()
'Por.Dante Amor
Set h = Sheets("Materiales")
For i = 21 To 39
If Cells(i, "C") <> "" Then
If Cells(i, "G") = 0 Or Cells(i, "G") < 0 Or Not IsNumeric(Cells(i, "G")) Then
MsgBox "Cantidad incorrecta", vbExclamation
Cells(i, "G").Select
Exit Sub
End If
'
Set b = h.Columns("A").Find(Cells(i, "C"), lookat:=xlWhole)
If b Is Nothing Then
MsgBox "El material no existe. No se puede continuar", vbExclamation
Cells(i, "C").Select
Exit Sub
Else
stock = h.Cells(b.Row, "L")
If stock < Cells(i, "G") Then
MsgBox "Existencia menor a la Cantidad solicitada", vbCritical
Cells(i, "G").Select
Exit Sub
End If
End If
Else
Exit For
End If
Next
'
For i = 21 To 39
If Cells(i, "C") <> "" Then
Set b = h.Columns("A").Find(Cells(i, "C"), lookat:=xlWhole)
h.Cells(b.Row, "L") = h.Cells(b.Row, "L") - Cells(i, "G")
End If
Next
MsgBox "Existencias actualizadas"
End Sub
' : )
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
' : )