Bonjour,
J'ai un petit problème, J'ai une procédure Principale qui appelle une procédure de Facturation d'un produit avec un simple
Dans la procédure, il y a une condition
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 SELECT Case FactureType CASE "MaFactureType" CALL MaFactureappel d'une procédure EviterTicketOUDoublon 'Dans le tableau qui contient les produits à facturer si l il manque 1 contrat, il y a un ticket et on ne facture pas et on passe à la ligne suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part IF faFINAL = "FINAL"
Si c'est une facture finale, il y a un onglet d'historique ou chaque ligne de la facture est inscrite sinon non :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 If Sheets(sData).Cells(ChRow, fMid).Value = fdDuo Then GoTo EviterTicketsOuDoublons With Sheets(chTab) .Cells(j, 1).Value = Sheets(sData).Cells(ChRow, Fval1) .Cells(j, 2).Value = Sheets(sData).Cells(ChRow, Fval2) .Cells(j, 3).Value = Sheets(sData).Cells(ChRow, Fval3) .Cells(j, 4).Value = Sheets(sData).Cells(ChRow, Fval4) .Cells(j, 5).Value = Sheets(sData).Cells(ChRow, Fval5) .Cells(j, 6).Value = Sheets(sData).Cells(ChRow, Fval6) .Cells(j, 12).FormulaR1C1 = "=RC[-1]*RC[-2]" End With fdDuo = Sheets(sData).Cells(ChRow, fMid) j = j + 1 k = k + 1 If faFinal = "Final" Then Call historiserFinal
l'appel de l'historisation :
La première ligne est historisée ensuite fin du programme sans message d'erreur mais dans le mode debug un espin chRow à la valeur <Hors du contexte>.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 Sub historiserFinal() If Sheets(sData).Cells(ChRow, fTik).Value <> 0 Then GoTo Fin With Sheets(sHisto) .Cells(j, 1).Value = Sheets(sData).Cells(ChRow, Fval1) .Cells(j, 2).Value = Sheets(sData).Cells(ChRow, Fval2) .Cells(j, 3).Value = Sheets(sData).Cells(ChRow, Fval3) .Cells(j, 4).Value = Sheets(sData).Cells(ChRow, Fval4) .Cells(j, 5).Value = Sheets(sData).Cells(ChRow, Fval5) .Cells(j, 6).Value = Sheets(sData).Cells(ChRow, Fval6) .Cells(j, 12).FormulaR1C1 = "=RC[-1]*RC[-2]" End With
Merci si quelqu'un peut m'aider
Partager