Erreur 424 et erreur 9
Dunky
-
ThauTheme Messages postés 1564 Statut Membre -
ThauTheme Messages postés 1564 Statut Membre -
Bonjour, je rencontre un problème dans mon code vba qui m'affiche une erreur 424.
Le but est de rentrer des informations sur une colonne spécifique.
Le code est le suivant:
Sub ecriredansfichierexcel()
Range(idFiche).Value = CStr(Format(Now, "ddmmyyyyhhnnss"))
Dim TypeOperation As String
If FinRelation.Value And Denonciation And InitiativeBanque.Value = True Then
TypeOperation = " Fin de relation avec denonciation, initiative Banque "
Else
TypeOperation = " Fin de relation sans denonciation, initiative Banque "
End If
If FinRelation.Value And Denonciation And InitiativeClient.Value = True Then
TypeOperation = " Fin de relation avec denonciation, initiative client "
Else
TypeOperation = " Fin de relation sans denonciation, initiative Client "
End If
If CloturePartielle.Value And Denonciation And InitiativeBanque.Value = True Then
TypeOperation = " Clôture partielle avec denonciation, initiative banque "
Else
TypeOperation = " Cloture partielle non denonciation, initiative banque "
End If
If CloturePartielle.Value And Denonciation And InitiativeClient.Value = True Then
TypeOperation = " Clôture partielle non denonciation, initiative client "
Else
TypeOperation = " Clôture partielle non denonciation, initiative client "
End If
'ActiveWorkbook.Worksheets("Formulaire de cloture").Activate
With Workbooks("suivi_Tracking.xlsm").Sheets("Feuill")
Dim lRow As Long
lRow = .Cells(Rows.Count, 1).End(xlUp).Row
.Range("A" + CStr(lRow + 1)) = "Cloture"
.Range("B" + CStr(lRow + 1)) = "TypeOperation"
.Range("C" + CStr(lRow + 1)) = CStr(Range(idFiche))
.Range("D" + CStr(lRow + 1)) = CStr(Range(Form_nom)) + CStr(Range(Form_ptf1)) + CStr(Range(Form_ptf2)) + CStr(Range(Form_ptf3)) + CStr(Range(Form_ptf4))
.Range("E" + CStr(lRow + 1)) = Range("C9")
.Range("F" + CStr(lRow + 1)) = Now
.Range("G" + CStr(lRow + 1)) = Application.UserName
.Range("H" + CStr(lRow + 1)) = CStr(etape)
End With
Workbooks("suivi_Tracking.xlsm").Close SaveChanges:=True
End Sub
Je vous remercie d'avance pour votre aide.
Le but est de rentrer des informations sur une colonne spécifique.
Le code est le suivant:
Sub ecriredansfichierexcel()
Range(idFiche).Value = CStr(Format(Now, "ddmmyyyyhhnnss"))
Dim TypeOperation As String
If FinRelation.Value And Denonciation And InitiativeBanque.Value = True Then
TypeOperation = " Fin de relation avec denonciation, initiative Banque "
Else
TypeOperation = " Fin de relation sans denonciation, initiative Banque "
End If
If FinRelation.Value And Denonciation And InitiativeClient.Value = True Then
TypeOperation = " Fin de relation avec denonciation, initiative client "
Else
TypeOperation = " Fin de relation sans denonciation, initiative Client "
End If
If CloturePartielle.Value And Denonciation And InitiativeBanque.Value = True Then
TypeOperation = " Clôture partielle avec denonciation, initiative banque "
Else
TypeOperation = " Cloture partielle non denonciation, initiative banque "
End If
If CloturePartielle.Value And Denonciation And InitiativeClient.Value = True Then
TypeOperation = " Clôture partielle non denonciation, initiative client "
Else
TypeOperation = " Clôture partielle non denonciation, initiative client "
End If
'ActiveWorkbook.Worksheets("Formulaire de cloture").Activate
With Workbooks("suivi_Tracking.xlsm").Sheets("Feuill")
Dim lRow As Long
lRow = .Cells(Rows.Count, 1).End(xlUp).Row
.Range("A" + CStr(lRow + 1)) = "Cloture"
.Range("B" + CStr(lRow + 1)) = "TypeOperation"
.Range("C" + CStr(lRow + 1)) = CStr(Range(idFiche))
.Range("D" + CStr(lRow + 1)) = CStr(Range(Form_nom)) + CStr(Range(Form_ptf1)) + CStr(Range(Form_ptf2)) + CStr(Range(Form_ptf3)) + CStr(Range(Form_ptf4))
.Range("E" + CStr(lRow + 1)) = Range("C9")
.Range("F" + CStr(lRow + 1)) = Now
.Range("G" + CStr(lRow + 1)) = Application.UserName
.Range("H" + CStr(lRow + 1)) = CStr(etape)
End With
Workbooks("suivi_Tracking.xlsm").Close SaveChanges:=True
End Sub
Je vous remercie d'avance pour votre aide.
Configuration: Android / Chrome 80.0.3987.132
1 réponse
-
Bonjour Dunky, bonjour le forum,
Quelles sont les lignes qui provoquent les erreurs ?
Utilise les balises pour le code c'est bien plus facile pour nous...
-
Bonjour thautheme, merci pour ta réponse ça ne m'affiche pas de ligne spécifique et en soit le code s'execute sur la feuille excel mais il m'affiche un message d'erreur 424 sur la console visual basic. Pour les balises je ne sais pas ce que c'est pourrais-tu m'en dire plus ?
- Re,
Ton code possède quantité de variables dont on ignore la provenance. Sans fichier, impossible de t'en dire plus. Pour un fichier joint regarde, parmi tant d'autres, https://www.cjoint.com
Pour les balises, clique sur la flèche vers le bas à coté de <> et choisit Basic. Le code doit se trouver enter les deux crochets.
-