Sub compare_liste_tableaux()
Dim m%, n%, te, tc, derle%, derlc%
Set she = Sheets("Extraction")
Set shC = Sheets("Causeries")
te = she.Range("A6:F" & she.Cells(Rows.Count, 1).End(xlUp).Row)
tc = shC.Range("A6:F" & shC.Cells(Rows.Count, 1).End(xlUp).Row)
derle = she.Cells(Rows.Count, 1).End(xlUp).Row
derlc = shC.Cells(Rows.Count, 1).End(xlUp).Row
'--- suppression lignes non retrouv?es tableau "Extraction"
For m = LBound(tc, 1) To UBound(tc, 1)
For n = LBound(te, 1) To UBound(te, 1)
If tc(m, 1) = te(n, 1) Then
GoTo prochain
Else
End If
Next n
shC.Rows(m + 1).Delete
prochain:
Next m
'--- ajout nouvelle ligne issue du tableau "Causeries"
derle = she.Cells(Rows.Count, 1).End(xlUp).Row
derlc = shC.Cells(Rows.Count, 1).End(xlUp).Row
For m = LBound(te, 1) To UBound(te, 1)
For n = LBound(tc, 1) To UBound(tc, 1)
If te(m, 1) = tc(n, 1) Then
GoTo prochain2
Else
End If
Next n
she.Rows(m + 1).Copy shC.Rows(derlc + 1)
derlc = shC.Cells(Rows.Count, 1).End(xlUp).Row
prochain2:
Next m
'--- tri ? nouveau de tous les tableaux
Call tri_tableau_sheetsCE
shC.Select: Range("A1").Select
End Sub
Sub z_copy_row()
'--- pour essai
Set she = Sheets("Extraction")
Set shC = Sheets("Causeries")
te = she.Range("A6:F" & she.Cells(Rows.Count, 1).End(xlUp).Row)
tc = shC.Range("A6:F" & shC.Cells(Rows.Count, 1).End(xlUp).Row)
derle = she.Cells(Rows.Count, 1).End(xlUp).Row
derlc = shC.Cells(Rows.Count, 1).End(xlUp).Row
For m = LBound(te, 1) To UBound(te, 1)
For n = LBound(tc, 1) To UBound(tc, 1)
If te(m, 1) = tc(n, 1) Then
GoTo prochain2
Else
End If
Next n
she.Rows(m + 1).Copy shC.Rows(derlc + 1)
derlc = shC.Cells(Rows.Count, 1).End(xlUp).Row
prochain2:
Next m
End Sub
Sub tri_tableau_sheetsCE()
Dim i%
For i = 1 To 2
Sheets(i).Activate: Range("B6").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("B6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Next i
End Sub