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
|
Sub rename_data()
Dim line As Integer
Dim col As Integer
Dim last_line As Integer
Dim last_col As Integer
Dim val As String
Dim oldVal As Text
Dim newVal As Text
line = 2: col = 1
last_line = Cells.SpecialCells(xlCellTypeLastCell).Row
last_col = Cells.SpecialCells(xlCellTypeLastCell).Column
For line = 2 To last_line
oldVal = Sheets("Rename").Cells(line, 1).Value
newVal = Sheets("Rename").Cells(line, 2).Value
Sheets("expguer").UsedRange.Replace What:=oldVal, replacement:=newVal
MsgBox CStr(Len(newVal))
Next line
End Sub |
Partager