KTM
XLDnaute Impliqué
Salut chers tous
Je voudrais élaborer une macro pour lancer une recherche dans une base
j'ai fais ceci mais apparemment c'est mal élaboré ( Je suis apprenti VBA)
Pouvez vous me donner un coup de pouce ?
NB : (On peut le faire avec la combinaison index Equiv mais je voudrais essayé VBA)
Sub recherche()
Dim x As Integer
Set x = Application.Match(Range("G2"), Range("A1:A100"), 0)
If Range("A" & Rows.Count).End(xlUp).Row > 2 Then
If Not x Is Nothing Then
Range("G3").Value = Cells(x, 2)
Range("G4").Value = Cells(x, 3)
Range("G5").Value = Cells(x, 4)
End If
End If
End Sub
Je voudrais élaborer une macro pour lancer une recherche dans une base
j'ai fais ceci mais apparemment c'est mal élaboré ( Je suis apprenti VBA)
Pouvez vous me donner un coup de pouce ?
NB : (On peut le faire avec la combinaison index Equiv mais je voudrais essayé VBA)
Sub recherche()
Dim x As Integer
Set x = Application.Match(Range("G2"), Range("A1:A100"), 0)
If Range("A" & Rows.Count).End(xlUp).Row > 2 Then
If Not x Is Nothing Then
Range("G3").Value = Cells(x, 2)
Range("G4").Value = Cells(x, 3)
Range("G5").Value = Cells(x, 4)
End If
End If
End Sub