****
w:
Application.StatusBar = " Deuxième passage en cours... Réconciliation avec éclatement des quantités...Patientez "
End Sub
Sub Rf2(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
'Référence pour les nouvelles lignes trouvées
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 2)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 2)
End If
'Point d'impact
If Not IsEmpty(Cells(i, pop)) Then
testmarque2 = Cells(i, pop)
référence = Cells(i, Ref)
Workbooks(feuilleextract).Activate
Call g2(testmarque2, feuillefact, lastline2, Résult, i, pop, référence)
End If
Next i
Call Rf3(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g2(testmarque2, feuillefact, lastline2, Résult, i, pop, référence)
'Référence pour les nouvelles lignes trouvées, bouocle N°2 comme vu à l'étape N°1
For z = testmarque2 To lastline2
rtestfinal = 0
rtestmarque2 = 0
If testmarque2 = Cells(z, 27) Then
rtestmarque2 = 1
End If
rtestfinal2 = rtestmarque2
If rtestfinal2 = 1 Then
If Cells(z, 21) = "" Or Cells(z, 21) = "A SUPPRIMER" Then
Cells(z, 21).Value = référence
Cells(z, 256).Value = "AUTO RECON"
Workbooks(feuillefact).Activate
GoTo k:
Else
Workbooks(feuillefact).Activate
Cells(i, pop).Clear
Range(Cells(i, Résult), Cells(i, 200)).Clear
End If
End If
Next z
k:
End Sub
Sub Rf3(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
'Référence pour les nouvelles lignes trouvées : On attribue sur la colonne 3 soit Résultat + 2 avec la même logique
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 3)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 3)
End If
If Not IsEmpty(Cells(i, pop)) Then
testmarque3 = Cells(i, pop)
référence = Cells(i, Ref)
Workbooks(feuilleextract).Activate
Call g3(testmarque3, feuillefact, lastline2, Résult, i, pop, référence)
End If
Next i
Call Rf4(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g3(testmarque3, feuillefact, lastline2, Résult, i, pop, référence)
For z = testmarque3 To lastline2
rtestfinal2 = 0
rtestmarque3 = 0
If testmarque3 = Cells(z, 27) Then
rtestmarque3 = 1
End If
rtestfinal2 = rtestmarque3
If rtestfinal2 = 1 Then
If Cells(z, 21) = "" Or Cells(z, 21) = "A SUPPRIMER" Then
Cells(z, 21).Value = référence
Cells(z, 256).Value = "AUTO RECON"
Workbooks(feuillefact).Activate
GoTo l:
Else
Workbooks(feuillefact).Activate
Cells(i, pop).Clear
Range(Cells(i, Résult), Cells(i, 200)).Clear
End If
End If
Next z
l:
End Sub
Sub Rf4(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 4)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 4)
End If
If Not IsEmpty(Cells(i, pop)) Then
testmarque4 = Cells(i, pop)
référence = Cells(i, Ref)
Workbooks(feuilleextract).Activate
Call g4(testmarque4, feuillefact, lastline2, Résult, i, pop, référence)
End If
Next i
Call Rf5(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g4(testmarque4, feuillefact, lastline2, Résult, i, pop, référence)
For z = testmarque4 To lastline2
rtestfinal2 = 0
rtestmarque4 = 0
If testmarque4 = Cells(z, 27) Then
rtestmarque4 = 1
End If
rtestfinal2 = rtestmarque4
If rtestfinal2 = 1 Then
If Cells(z, 21) = "" Or Cells(z, 21) = "A SUPPRIMER" Then
Cells(z, 21).Value = référence
Cells(z, 256).Value = "AUTO RECON"
Workbooks(feuillefact).Activate
GoTo l:
Else
Workbooks(feuillefact).Activate
Cells(i, pop).Clear
Range(Cells(i, Résult), Cells(i, 200)).Clear
End If
End If
Next z
l:
End Sub
Sub Rf5(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 5)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 5)
End If
If Not IsEmpty(Cells(i, pop)) Then
testmarque5 = Cells(i, pop)
référence = Cells(i, Ref)
Workbooks(feuilleextract).Activate
Call g5(testmarque5, feuillefact, lastline2, Résult, i, pop, référence)
End If
Next i
Call Rf6(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g5(testmarque5, feuillefact, lastline2, Résult, i, pop, référence)
For z = testmarque5 To lastline2
rtestfinal2 = 0
rtestmarque5 = 0
If testmarque5 = Cells(z, 27) Then
rtestmarque5 = 1
End If
rtestfinal2 = rtestmarque5
If rtestfinal2 = 1 Then
If Cells(z, 21) = "" Or Cells(z, 21) = "A SUPPRIMER" Then
Cells(z, 21).Value = référence
Cells(z, 256).Value = "AUTO RECON"
Workbooks(feuillefact).Activate
GoTo l:
Else
Workbooks(feuillefact).Activate
Cells(i, pop).Clear
Range(Cells(i, Résult), Cells(i, 200)).Clear
End If
End If
Next z
l:
End Sub
Public Function FileExists(strfile As String) As Boolean
If Dir(strfile) = "" Then
FileExist = False
Else
FileExist = True
End If
End Function
Sub comptage(feuillefact, Résult, Prix, Deb)
Dim run As Variant
Dim nom_de_la_facture As String
'Pour référencer la facture
'A activer pour aide au pointage
'Call aidepointage
Workbooks(feuilleextract2).Close savechanges:=False
Workbooks(feuillefact).Activate
nom_de_la_facture = Cells(Deb, Ref)
n = 0
For Each Cell In Range(Cells(Deb, Résult), Cells(65500, Résult))
'Workbooks(feuillefact).Column (Résult)
If Not IsEmpty(Cell) Then n = n + 1
Next Cell
m = 0
For Each Cell In Range(Cells(Deb, Prix), Cells(65500, Prix))
If Not IsEmpty(Cell) Then m = m + 1
Next Cell
Application.StatusBar = " Traitement terminé "
MsgBox ("Nombre de lignes traitées : " & m) + Chr(13) + ("Nombre de lignes trouvées : " & n) + Chr(13) + ("Pourcentage de lignes trouvées : " & n / m * 100 & " %") + Chr(13) + ("Traitement terminé, vous pouvez quitter")
'Ajout au fichier Stats avec les deux possibilité en fonction de l'ordinateur
Workbooks.Open filename:="F:\BusinessData\CIB_SSCFees\Stats macro AUTO"
stat = ActiveWindow.Caption
lastline3 = lastline("E")
Cells(lastline3 + 1, "A").Value = nom_de_la_facture
Cells(lastline3 + 1, "E").Value = m
Cells(lastline3 + 1, "F").Value = n
Cells(lastline3 + 1, "C").Value = feuilleextract
Cells(lastline3 + 1, "D").Value = Date
Workbooks("Stats macro AUTO.xls").Close savechanges:=True
Workbooks(feuillefact).Activate
Application.StatusBar = ""
'*******Permettre d'aller vers la feuille de travail***********
If CheckBox13 = True Then
Call travail
End If
Application.ScreenUpdating = True
End
End Sub
Sub aidepointage()
'******************************************************************************************************************************
'On va ajouter un N° qui permet de conserver l'ordre de la facture, ainsi on retrouvera plus facilement les stratégies
'******************************************************************************************************************************
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Not IsEmpty(Range(Résult & i)) Then
testaide = Cells(i, Résult)
pointage = Cells(i, RET)
Workbooks(feuilleextract).Activate
Call rf_part34(testaide, feuillefact, lastline2, Résult, i, pointage)
End If
Next i
Call Rf2bis(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub rf_part34(testaide, feuillefact, lastline2, Résult, i, pointage)
For z = 2 To lastline2
rtestfinal2 = 0
rtestmarque = 0
If testaide = Cells(z, 27) Then
Cells(z, 24).Value = pointage
Workbooks(feuillefact).Activate
GoTo j:
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des aides au pointage...Patientez... "
Next z
j:
End Sub
Sub Rf2bis(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 2)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 2)
End If
'Point d'impact
If Not IsEmpty(Cells(i, pop)) Then
testaide = Cells(i, pop)
pointage = Cells(i, RET)
Workbooks(feuilleextract).Activate
Call g2bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
End If
Next i
Call Rf3bis(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g2bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
For z = testaide To lastline2
rtestfinal2 = 0
rtestmarque = 0
If testaide = Cells(z, 27) Then
rtestaide = 1
End If
rtestfinal2 = rtestaide
If rtestfinal2 = 1 Then
Cells(z, 24).Value = pointage
Workbooks(feuillefact).Activate
GoTo j:
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des aides au pointage...Patientez... "
Next z
j:
End Sub
Sub Rf3bis(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 3)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 3)
End If
'Point d'impact
If Not IsEmpty(Cells(i, pop)) Then
testaide = Cells(i, pop)
pointage = Cells(i, RET)
Workbooks(feuilleextract).Activate
Call g3bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
End If
Next i
Call Rf4bis(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g3bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
For z = testaide To lastline2
rtestfinal2 = 0
rtestmarque = 0
If testaide = Cells(z, 27) Then
rtestaide = 1
End If
rtestfinal2 = rtestaide
If rtestfinal2 = 1 Then
Cells(z, 24).Value = pointage
Workbooks(feuillefact).Activate
GoTo j:
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des aides au pointage...Patientez... "
Next z
j:
End Sub
Sub Rf4bis(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 4)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 4)
End If
'Point d'impact
If Not IsEmpty(Cells(i, pop)) Then
testaide = Cells(i, pop)
pointage = Cells(i, RET)
Workbooks(feuilleextract).Activate
Call g4bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
End If
Next i
Call Rf5bis(Deb, Résult, feuilleextract, feuillefact)
End Sub
Sub g4bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
For z = testaide To lastline2
rtestfinal2 = 0
rtestmarque = 0
If testaide = Cells(z, 27) Then
rtestaide = 1
End If
rtestfinal2 = rtestaide
If rtestfinal2 = 1 Then
Cells(z, 24).Value = pointage
Workbooks(feuillefact).Activate
GoTo j:
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des aides au pointage...Patientez... "
Next z
j:
End Sub
Sub Rf5bis(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 5)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 5)
End If
'Point d'impact
If Not IsEmpty(Cells(i, pop)) Then
testaide = Cells(i, pop)
pointage = Cells(i, RET)
Workbooks(feuilleextract).Activate
Call g5bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
End If
Next i
End Sub
Sub g5bis(testaide, feuillefact, lastline2, Résult, i, pop, pointage)
For z = testaide To lastline2
rtestfinal2 = 0
rtestmarque = 0
If testaide = Cells(z, 27) Then
rtestaide = 1
End If
rtestfinal2 = rtestaide
If rtestfinal2 = 1 Then
Cells(z, 24).Value = pointage
Workbooks(feuillefact).Activate
GoTo j:
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des aides au pointage...Patientez... "
Next z
j:
End Sub
Sub provisoire(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Not IsEmpty(Range(Résult & i)) Then
testmarque = Cells(i, Résult)
Workbooks(feuilleextract).Activate
Call rf_part21(testmarque, feuillefact, lastline2, Résult, i, pointage)
End If
Next i
End Sub
Sub rf_part21(testmarque, feuillefact, lastline2, Résult, i, pointage)
Workbooks(feuilleextract).Activate
lastline3 = lastline("C")
For z = 2 To lastline3
rtestfinal = 0
rtestmarque = 0
If testmarque = Cells(z, 27) Then
If Cells(z, 21) = "" Then
Cells(z, 21).Value = "A SUPPRIMER"
Workbooks(feuillefact).Activate
GoTo j:
End If
End If
Application.StatusBar = " Nber ligne Facture: " & i - Deb + 1 & " Traitement en cours...Ajout des références provisoire...Patientez... "
'Workbooks(feuillefact).Activate
Next z
j:
Workbooks(feuillefact).Activate
End Sub
Sub Rf6(Deb, Résult, feuilleextract, feuillefact)
Workbooks(feuillefact).Activate
For i = Deb To lastline1
If Asc(Left(Résult, 1)) < 97 Then
pop = (Asc(Left(Résult, 1)) - 65 + 6)
Else
pop = (Asc(Left(Résult, 1)) - 97 + 6)
End If
If Not IsEmpty(Cells(i, pop)) Then
testmarque6 = Cells(i, pop)
référence = Cells(i, Ref)
Workbooks(feuilleextract).Activate
Call g6(testmarque6, feuillefact, lastline2, Résult, i, pop, référence)
End If
Next i
End Sub
Sub g6(testmarque6, feuillefact, lastline2, Résult, i, pop, référence)
For z = testmarque6 To lastline2
rtestfinal2 = 0
rtestmarque6 = 0
If testmarque6 = Cells(z, 27) Then
If Cells(z, 21) = "" Or Cells(z, 21) = "A SUPPRIMER" Then
Cells(z, 21).Value = référence
Cells(z, 256).Value = "AUTO RECON"
Workbooks(feuillefact).Activate
End If
End If
Next z
End Sub
Sub travail()
Dim onglet As Worksheet
'On ajoute un classeur pour exporter les références à rechercher
iSheets = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = 1
Workbooks.Add
Application.SheetsInNewWorkbook = iSheets
feuilletravail2 = ActiveWindow.Caption
'On copie les référence sur une feuille provisoire
Workbooks(feuillefact).Activate
Cells.Select
selection.Copy
Workbooks(feuilletravail2).Activate
Range("A1").Select
ActiveSheet.Paste
Macel***e = Ref & Deb
Range(Macel***e).Select
ActiveCell.CurrentRegion.Sort Key1:=Range(Macel***e), Order1:=xlAscending, Header:=xlYes
donnee1 = ActiveCell
ActiveCell.Offset(1, 0).Select
While ActiveCell <> ""
If ActiveCell = donnee1 Then
ActiveCell.EntireRow.Delete
ActiveCell.Offset(-1, 0).Select
donnee1 = ActiveCell
ActiveCell.Offset(1, 0).Select
Else
donnee1 = ActiveCell
ActiveCell.Offset(1, 0).Select
End If
Wend
'On recherche les Ref dans la nouvelle feuille
lastline8 = lastline(strike)
For i = Deb To lastline8
Workbooks(feuilletravail2).Activate
If Cells(i, Ref) <> "" Then
'If Cells(i, Résult) <> "" Then
ref1 = Cells(i, Ref)
Call travail2(feuilletravail2, ref1)
'End If
End If
Application.StatusBar = " Actuelle position des références sur la feuille travail: " & i - Deb + 1 & "/" & lastline8
Next i
Call manque(feuilletravail2, feuilletravail, ref1)
Workbooks(feuilletravail2).Close savechanges:=False
Workbooks(feuilletravail).Activate
For Each onglet In Worksheets
onglet.Select
If ActiveSheet.Name Like "*Feuil*" Then
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End If
Call MEF_cal
Next onglet
Workbooks(feuilletravail).Activate
Sheets(1).Activate
MsgBox ("Opération terminée, si vous avez activés les calculs AUTO, ces derniers vont démarrer sinon vous pouvez quitter")
If CheckBox14 = True Then
MsgBox ("En construction...")
'Call calcul_AUTO
End If
End Sub
Sub travail2(feuilletravail2, ref1)
Workbooks(feuilleextract).Activate
lastline6 = lastline("C")
Cells(1, 1).EntireRow.Select
selection.Copy
Workbooks(feuilletravail).Activate
ActiveSheet.Paste
Workbooks(feuilleextract).Activate
'On efface le filtre
selection.AutoFilter Field:=3, Criteria1:="V"
Application.CutCopyMode = False
ActiveSheet.ShowAllData
For z = 2 To lastline6
Workbooks(feuilleextract).Activate
If Cells(z, 21) = ref1 Then
Cells(z, 21).EntireRow.Select
selection.Copy
Workbooks(feuilletravail).Activate
lastlineH = lastline("A")
Cells(lastlineH + 1, 1).Select
ActiveSheet.Paste
Workbooks(feuilleextract).Activate
End If
If z = lastline6 Then
Workbooks(feuilletravail).Activate
ActiveSheet.Name = ref1
ActiveSheet.Next.Select
End If
Next z
End Sub
Sub MEF_cal()
'*******Mettre en forme la feuille de calcul******
If Range("A1") <> "" Then
If Range("V1") <> "Taux" Then
Columns("AM:IV").Select
selection.Clear
Columns("C:C").ColumnWidth = 2.71
Columns("D

").ColumnWidth = 7
Columns("E:E").ColumnWidth = 6.71
Columns("D

").Select
selection.EntireColumn.Hidden = True
Columns("I:I").ColumnWidth = 3.14
Columns("H:H").ColumnWidth = 18.57
Columns("J:J").ColumnWidth = 4.71
Columns("K:K").ColumnWidth = 5
Columns("L:L").ColumnWidth = 5.86
Columns("M:M").ColumnWidth = 2.43
Columns("N:N").ColumnWidth = 5.86
Columns("O:O").ColumnWidth = 8.71
Columns("P

").Select
selection.EntireColumn.Hidden = True
Columns("Q:Q").Select
selection.EntireColumn.Hidden = True
Columns("S:S").ColumnWidth = 6.57
Columns("T:T").ColumnWidth = 8
Columns("U:U").Select
Application.CutCopyMode = False
selection.Delete Shift:=xlToLeft
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
Columns("W:AB").Select
selection.ClearContents
Columns("V:V").Select
selection.Insert Shift:=xlToRight
Range("V1").Select
ActiveCell.FormulaR1C1 = "Taux"
Range("U1").Select
ActiveCell.FormulaR1C1 = "Cours"
Range("X1").Select
ActiveCell.FormulaR1C1 = "Calcul"
Range("T1").Select
selection.Copy
Range("T1:X1").Select
selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("H3").Select
End If
End If
End Sub
Sub manque(feuilletravail2, feuilletravail, ref1)
Workbooks(feuilletravail).Activate
Sheets(1).Activate
Workbooks(feuilletravail2).Activate
lastlineP = lastline(strike)
For i = Deb To lastlineP
Workbooks(feuilletravail2).Activate
If Cells(i, Ref) <> "" Then
ref1 = Cells(i, Ref)
Call travail3(feuilletravail2, feuilletravail, ref1)
End If
Application.StatusBar = " Actuelle position des références non trouvées sur la feuille travail: " & i - Deb + 1 & "/" & lastlineP
Next i
End Sub
Sub travail3(feuilletravail2, feuilletravail, ref1)
Workbooks(feuilletravail).Activate
lastline6 = lastline("C")
Workbooks(feuillefact).Activate
Cells(Deb - 1, Ref).EntireRow.Select
selection.Copy
Workbooks(feuilletravail).Activate
Cells(lastline6 + 4, 1).Select
ActiveSheet.Paste
Workbooks(feuillefact).Activate
lastline7 = lastline("B")
For z = 2 To lastline7
Workbooks(feuillefact).Activate
If Cells(z, Ref) = ref1 Then
If Cells(z, Résult) = "" Then
Cells(z, Ref).EntireRow.Select
selection.Copy
Workbooks(feuilletravail).Activate
lastlineH = lastline(strike)
Cells(lastlineH + 1, 1).Select
ActiveSheet.Paste
Workbooks(feuillefact).Activate
End If
End If
Next z
Workbooks(feuilletravail).Activate
If Cells(lastline6 + 5, 2) = "" Then
Cells(lastline6 + 4, 1).EntireRow.Select
selection.Delete
Call MEF_cal
Call TCD2(feuilletravail2, feuilletravail, ref1)
End If
ActiveSheet.Next.Select
End Sub
Sub TCD2(feuilletravail2, feuilletravail, ref1)
lastlineM = lastline("C")
lieu = ("H" & lastlineM + 3)
If Range("A1") = "External trade number" Then
Call Listé(lieu, poulet)
End If
If Range("A1") Like "*External*" Then
Call Listé(lieu, poulet)
End If
End Sub
Sub OTC(lieu)
bobo = lastline("A")
dernièreColonne1 = selection.CurrentRegion.End(xlToRight).Column
lol = Range(Cells(1, "A"), Cells(bobo, dernièreColonne1))
compteur = compteur + 1
Nom = "TCD N°" & compteur
'TCD
ActiveSheet.PivotTableWizard _
SourceType:=xlDatabase, _
SourceData:=ActiveSheet.Range(Cells(1, "A"), Cells(bobo, dernièreColonne1)), _
TableDestination:=Range(lieu), _
TableName:=Nom
'Variable TCD
ActiveSheet.PivotTables(Nom).AddFields RowFields:= _
"Portfolio"
ActiveSheet.PivotTables(Nom).PivotFields("Brokerage"). _
Orientation = xlDataField
End Sub
Sub Strat(lieu)
bobo = lastline("A")
dernièreColonne1 = selection.CurrentRegion.End(xlToRight).Column
lol = Range(Cells(1, "A"), Cells(bobo, dernièreColonne1))
compteur = compteur + 1
Nom = "TCD N°" & compteur
'TCD
ActiveSheet.PivotTableWizard _
SourceType:=xlDatabase, _
SourceData:=ActiveSheet.Range(Cells(1, "A"), Cells(bobo, dernièreColonne1)), _
TableDestination:=Range(lieu), _
TableName:=Nom
'Variable TCD
ActiveSheet.PivotTables(Nom).AddFields RowFields:= _
"Book"
ActiveSheet.PivotTables(Nom).PivotFields("COURTAGE"). _
Orientation = xlDataField
End Sub
Sub Listé(lieu, poulet)
bobo = lastline("A")
dernièreColonne1 = selection.CurrentRegion.End(xlToRight).Column
poulet = Range(Cells(1, "A"), Cells(bobo, dernièreColonne1))
compteur8 = compteur8 + 1
Nom = "TCD N°" & compteur8
'TCD
ActiveSheet.PivotTableWizard _
SourceType:=xlDatabase, _
SourceData:=ActiveSheet.Range(Cells(1, "A"), Cells(bobo, dernièreColonne1)), _
TableDestination:=Range(lieu), _
TableName:=Nom
'Variable TCD
ActiveSheet.PivotTables(Nom).AddFields RowFields:= _
"""Party code"""
ActiveSheet.PivotTables(Nom).PivotFields("COURTAGE"). _
Orientation = xlDataField
End Sub
Private Sub Label16_Click()
End Sub
Private Sub MultiPage1_Change()
End Sub