1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Public Function ReplaceChars(varStringToReplace As String)
CHAINE_DEPART = "àäâãçéèêëìïîôöòûüùÿÁÀÄÂÃÉÈÊËÍÎÌÔÖÒÓÕÜÛÙÚÝ"
CHAINE_ARRIVE = "aaaaceeeeiiiooouuyyAAAAAEEEEIIIOOOOOUUUUY"
For i = 1 To Len(CHAINE_DEPART)
varStringToReplace = Replace(varStringToReplace, Mid(CHAINE_DEPART, i, 1), Mid(CHAINE_ARRIVE, i, 1))
Next i
ReplaceChars = varStringToReplace
End Function
Sub AssembleDonnes2()
Feuil3.Cells.Clear
With Feuil1
.Columns("A:A").Insert Shift:=xlToRight
.Cells(1, 1) = "Key1"
For i = 2 To .Range("A1").CurrentRegion.Rows.Count
.Cells(i, 1) = UCase(ReplaceChars(Replace(Join( _
Array(.Cells(i, 3), .Cells(i, 4), .Cells(i, 5))), " ", "")))
Next i
.Range("A2").CurrentRegion.Sort Key1:=.Range("A2"), Header:= _
xlGuess
.Columns("A:I").Copy Feuil3.Range("A1")
.Columns("A:A").Delete Shift:=xlToLeft
End With
With Feuil2
.Columns("A:A").Insert Shift:=xlToRight
.Cells(1, 1) = "Key2"
For i = 2 To .Range("A1").CurrentRegion.Rows.Count
.Cells(i, 1) = UCase(ReplaceChars(Replace(Join( _
Array(.Cells(i, 2), .Cells(i, 3), .Cells(i, 4))), " ", "")))
Next i
.Range("A2").CurrentRegion.Sort Key1:=.Range("A2"), Header:= _
xlGuess
.Columns("A:I").Copy Feuil3.Range("J1")
.Columns("A:A").Delete Shift:=xlToLeft
End With
End Sub |