Excel VBA function range.replace
Hi everybody,
I have a small issue with the fonction Range.Replace.
I have the following code:
Columns("F:H").Select
Selection.Replace What:="Dec", Replacement:="Dez", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
Selection.Replace What:="Oct", Replacement:="Okt", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
Selection.Replace What:="May", Replacement:="Mai", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
Selection.Replace What:="Mar", Replacement:="Mär", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
Selection.Replace What:="-", Replacement:=".", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
Everything works well except when I replace "-" with "."
all "-" are replaced by a "." in the complete sheet instead of only in the range.
I tried as well to replace Columns("F:H").Select by Range(Cells(2, 6), Cells(Last_Row_Import, 8)).Select but still the same.
did someone already face this issue?
thank you for your support.
|