Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-21-2019, 03:37 AM
thomas47 thomas47 is offline Excel VBA function range.replace Windows 7 64bit Excel VBA function range.replace Office 2010 64bit
Novice
Excel VBA function range.replace
 
Join Date: Mar 2014
Location: France
Posts: 6
thomas47 is on a distinguished road
Default 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.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA function range.replace Using IF Function where logical test is for range of values guciolino Excel 10 02-13-2017 08:05 AM
Excel VBA function range.replace Help with Index Function to Select Range of Cells bretyuin Excel 1 02-24-2016 05:11 AM
Excel VBA function range.replace Using Left function to format a range USAOz Excel 4 09-10-2015 03:00 AM
Excel VBA function range.replace Find and Replace using Excel range dmarie123 Word VBA 15 04-02-2013 07:54 AM
Find and Replace within range anil3b2 Word VBA 3 12-01-2010 02:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft