1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| For Sheet = 1 To Sheets.Count
l_lastRow = Sheets(Sheet).Cells.SpecialCells(xlCellTypeLastCell).Row
l_lastColumn = Sheets(Sheet).Cells.SpecialCells(xlCellTypeLastCell).Column
For colonne = 1 To l_lastColumn
Texte = Sheets(Sheet).Cells(ROW_HEADER, colonne).Value
If LCase(Left(Texte, 11)) = "message id " And Texte <> "" Then
For ligne = ROW_1ST_DATA + 1 To l_lastRow
If Sheets(Sheet).Cells(ligne, colonne).Value <> "" Then
valeur = Sheets(Sheet).Cells(ligne, colonne).Value '- recupere la case, soit 'F1'!L6C1 par ex
longueur = Len(Sheets(Sheet).Cells(ligne, colonne).Value) '-recupere sa longueur
fin = Mid(valeur, longueur - 1) '-recupere la fin, pour savoir si c'est C1, pour ne pas le faire 50 fois :)
If fin = "C1" Then
gauche = Left(Sheets(Sheet).Cells(ligne, colonne).Value, longueur - 2) '-on vire le C1
final = Replace(gauche, "!L", "!A") '-et on remplace le L par le A
Sheets(Sheet).Cells(ligne, colonne).Value = final '-et on remet la version finale dans la case
End If
End If
Next
End If
Next
Next |
Partager