Bonjour,
j'ai un problème:
J'ai ce code VBa, mais excel m'affiche: incompatibilité de Type
Private Sub CommandButton1_Click()
With Sheets(Feuil1)
With .Range("A7:A60")
Set c = .Find(CInt(NumEquipe.Value), lookat:=xlWhole, LookIn:=xlValues) 'on cherche la valeur exacte du numéro d'equipe
If Not c Is Nothing Then 'si on trouve quelque chose, alors on note sa ligne
ligne = c.Row
Else
MsgBox ("Cette équipe n° " & CInt(NumEquipe.Value) & " n'existe pas")
Exit Sub
End If
End With
If NomdEquipe.Value = 0 Then
Else
.Cells(ligne, 2) = NomdEquipe.Value
End If
If Club.Value = 0 Then
Else
.Cells(ligne, 3) = Club.Value
End If
If Co1.Value = 0 Then
Else
.Cells(ligne, 4) = Co1.Value
End If
If tél1.Value = 0 Then
Else
.Cells(ligne, 11) = tél1.Value
End If
If Co2.Value = 0 Then
Else
.Cells(ligne, 0.5) = Co2.Value
End If
If Tél2.Value = 0 Then
Else
.Cells(ligne, 12) = Tél2.Value
End If
If Email.Value = 0 Then
Else
.Cells(ligne, 10) = Email.Value
End If
End With
End Sub
Alors qu'est-ce qui va pas?
Merci beaucoup d'avance
Rocornet
j'ai un problème:
J'ai ce code VBa, mais excel m'affiche: incompatibilité de Type
Private Sub CommandButton1_Click()
With Sheets(Feuil1)
With .Range("A7:A60")
Set c = .Find(CInt(NumEquipe.Value), lookat:=xlWhole, LookIn:=xlValues) 'on cherche la valeur exacte du numéro d'equipe
If Not c Is Nothing Then 'si on trouve quelque chose, alors on note sa ligne
ligne = c.Row
Else
MsgBox ("Cette équipe n° " & CInt(NumEquipe.Value) & " n'existe pas")
Exit Sub
End If
End With
If NomdEquipe.Value = 0 Then
Else
.Cells(ligne, 2) = NomdEquipe.Value
End If
If Club.Value = 0 Then
Else
.Cells(ligne, 3) = Club.Value
End If
If Co1.Value = 0 Then
Else
.Cells(ligne, 4) = Co1.Value
End If
If tél1.Value = 0 Then
Else
.Cells(ligne, 11) = tél1.Value
End If
If Co2.Value = 0 Then
Else
.Cells(ligne, 0.5) = Co2.Value
End If
If Tél2.Value = 0 Then
Else
.Cells(ligne, 12) = Tél2.Value
End If
If Email.Value = 0 Then
Else
.Cells(ligne, 10) = Email.Value
End If
End With
End Sub
Alors qu'est-ce qui va pas?
Merci beaucoup d'avance
Rocornet