السلام عليكم
استعمل هذا الكود
Private Sub CommandButton2_Click()
Dim LastRow As Long, i As Long, ii As Byte
With Sheets("العملاء")
LastRow = .Cells(.Rows.Count, "A").End(xlUp)
For i = 2 To LastRow
If .Cells(i, 1) = Range("e2") Then
For ii = 3 To 9
If IsEmpty(.Cells(i, ii)) Then
.Cells(i, ii) = Range("e16").Value
Exit For
End If
Next
End If
Next
End With
End Sub
book.rar