I have two sheets, invoice, and customer. On the invoice sheet, when I write the customer's name in cell A11, the rest of the customer's information comes up in A12 till A15. However, I want to change this information from the invoice sheet and copy it on the customer sheet. My code works for a customer. But I need this code for every customer. I need your idea, please
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Set sh1 = ThisWorkbook.Sheets("Customer")
Set sh4 = ThisWorkbook.Sheets("Invoice")
If Not Intersect(Target, sh4.Range("A12:A15")) Is Nothing Then
If sh4.Range("A11").Value = sh1.Range("B2").Value Then
sh1.Range("F2").Value = sh4.Range("A12").Value
sh1.Range("G2").Value = sh4.Range("A13").Value
End If
End If
End Sub