Error 91
xicamaria
-
xicamaria -
xicamaria -
Bonjour,
Je ne comprends pas pourquoi j'ai la erreur 91 "variable objet ou variable de bloc With non définie" dans la ligne maPlage = ActiveSheet.Columns(3) du code ci-dessous.
Private Sub onvatrouver()
Dim trouve As Range
Dim chaine As String
Dim maPlage As Range
chaine = "xxx"
maPlage = ActiveSheet.Columns(3)
trouve = maPlage.Cells.Find(what:=chaine, LookAt:=xlWhole)
MsgBox trouve.Address
End Sub
Merci de vos réponses
Je ne comprends pas pourquoi j'ai la erreur 91 "variable objet ou variable de bloc With non définie" dans la ligne maPlage = ActiveSheet.Columns(3) du code ci-dessous.
Private Sub onvatrouver()
Dim trouve As Range
Dim chaine As String
Dim maPlage As Range
chaine = "xxx"
maPlage = ActiveSheet.Columns(3)
trouve = maPlage.Cells.Find(what:=chaine, LookAt:=xlWhole)
MsgBox trouve.Address
End Sub
Merci de vos réponses
4 réponses
Bonjour,
Private Sub onvatrouver()
Dim chaine As String
Dim maPlage As Range
Dim trouve As Range
chaine = "xxx"
Set maPlage = ActiveSheet.Columns(3)
Set trouve = maPlage.Cells.Find(what:=chaine, LookAt:=xlWhole)
If Not trouve Is Nothing Then
MsgBox trouve.Address
Else
MsgBox "Pas trouvé, désolé........."
End If
End Sub