Erreur d'exécution 13
Bonjour,
Mon fichier excel me lance une erreur "Erreur d'exécutin '13' " et ça m'envoie sur ce qui est marqué en rouge. Le fichier rempli la feuille Rapport en fonction des données rentrées dans la feuille Planning. Des idées svp ? merci d'avance !!
Sub Report()
'Count the number of patine furnitures on dispo equipe
Call MobilierPatine
'Calls the solde code (to fill the "Solde capa patine" and "Solde capa total" lines:
Call colunas
Call ADM
Call Firstcolonne
'Starts the report code
L_1report = 6
C_1report = 2
ligneR = 8
For Ligne = 1 To 80
colonneR = 2
S_total = 0
S_RAL = 0
Future = 0
' Picks only the lines with a number in first column to put in report table
If Sheets("Planning").Cells(Ligne, 1) <> "" Then
Sheets("Report").Cells(ligneR, colonneR) = Sheets("Planning").Cells(Ligne, 2)
'Couleur = Sheets("Planning").Cells(ligne, 2).Interior.ColorIndex
'Sheets("Report").Cells(ligneR, colonneR).Interior.ColorIndex = Couleur
colonneR = colonneR + 1
'Goes to each column of the Planning tab to
For Colonne = 5 To 300 Step 5
If Sheets("Planning").Cells(1, Colonne) <> "" Then
Sheets("Report").Cells(ligneR, colonneR) = Sheets("Planning").Cells(Ligne, Colonne)
'Sheets("Report").Cells(ligneR, colonneR).Interior.ColorIndex = Couleur
colonneR = colonneR + 1
S_total = S_total + Sheets("Planning").Cells(Ligne, Colonne)
If Sheets("Report").Cells(L_1report + 1, colonneR) <> "Total" Then
Future = Sheets("Report").Cells(L_1report + 1, colonneR) - Now
If Future > 0 Then
S_RAL = S_RAL + Sheets("Planning").Cells(Ligne, Colonne)
End If
End If
End If
Next
Sheets("Report").Cells(ligneR, colonneR) = S_total
Sheets("Report").Cells(ligneR, colonneR + 1) = S_RAL
ligneR = ligneR + 1
S_total = 0
S_RAL = 0
End If
ligneR_fin = ligneR - 1
colonneR_fin = colonneR - 1
Next
'_______________________________________________
'InsideG = Sheets("RefColors").Cells(1, 1).Interior.ColorIndex
'InsideP = Sheets("RefColors").Cells(2, 1).Interior.ColorIndex
'InsideT = Sheets("RefColors").Cells(3, 1).Interior.ColorIndex
'BorderT = Sheets("RefColors").Cells(4, 1).Interior.ColorIndex
'InsideMT = Sheets("RefColors").Cells(5, 1).Interior.ColorIndex
'BorderMT = Sheets("RefColors").Cells(6, 1).Interior.ColorIndex
'BorderG = Sheets("RefColors").Cells(7, 1).Interior.ColorIndex
'
'
'With Sheets("Report")
' Set Rng = .Range(.Cells(L_1report + 2, C_1report), .Cells(ligneR_fin, colonneR_fin + 2))
' Rng.Select
'End With
'
'Selection.Interior.ColorIndex = InsideG
'
'With Selection.Borders(xlEdgeLeft)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
'With Selection.Borders(xlEdgeTop)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
'With Selection.Borders(xlEdgeBottom)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
'With Selection.Borders(xlEdgeRight)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
'With Selection.Borders(xlInsideVertical)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
'With Selection.Borders(xlInsideHorizontal)
'.LineStyle = xlContinuous
'.ColorIndex = BorderG
'.TintAndShade = 0
'.Weight = xlThin
'End With
Call colonne2 'To fill the sheet Planned Vs Real according to the planning
Call Realised
Call Planned
Call étiquettesWHS
Call packagingRTW
MsgBox "Report updated!"
End Sub
Bonjour,
En même temps je dois reconnaître que je ne comprends pas bien cette ligne non plus
Future = Sheets("Report").Cells(L_1report + 1, colonneR) - NowAu début du code il y a
Future = 0
Ensuite Future = cells(6+1, colonneR) ? - Now
Il y a quoi dans la cellule trouvée une date ? des heures ?
Now= date d'aujourdhui() + heure:minutes:secondes
oui c'est des dates ( jour/mois/année).
Tu veux que je t'envoie le fichier excel entier ? il est un peu costaud
[quote=sana96 post_id=815883 time=1574864032 user_id=66551]
oui c'est des dates ( jour/mois/année).
Dans ce cas si tu fais la différence entre deux date il vaut mieux utiliser "Date" à la place de "Now"
Future = Cdate(Sheets("Report").Cells(L_1report + 1, colonneR).value) - DateJ'ai essayé mais j'ai toujours la même erreur