Bonjour,
Je débute en VBA, et dans le code suivant, à la ligne iRow = r.row j'ai l'erreur 91 : variable objet ou variable de bloc With non définie.
Dans cette ligne je souhaite faire remonter la ligne correspondante à ma valeur recherchée.
Public Sub ComboBox1_Change()
Dim iRow As Integer
Dim r As Range
Dim sCus As String
Dim lSCode As Long
Dim sSid As String
Dim sSite As String
Dim sLoc As String
Dim sCom As String
Dim lDate As Long
Set ws = Sheets("Customer")
Set r = ws.Range("G5:G9999").Find(what:=ComboBox1.Value)
iRow = r.Row
lSCode = Cells(iRow, 5).Value
TextBox1.text = lSCode
sSid = Cells(iRow, 6).Value
TextBox2.text = sSid
sCus = Cells(iRow, 1).Value
TextBox3.text = sCus
sSite = Cells(iRow, 2).Value
TextBox4.text = sSite
sLoc = Cells(iRow, 3).Value
TextBox5.text = sLoc
sCom = Cells(iRow, 4).Value
TextBox6.text = sCom
lDate = Cells(iRow, 8).Value
TextBox7.text = lDate
End Sub
J'imagine donc que je ne définie pas comme il faut ma variable r, mais je ne comprend pas comment faire.
Merci d'avance !