Finad and Replace - how to read values from sheet

odeen

New member
Joined
Feb 7, 2013
Messages
1
Reaction score
0
Points
0
Hi All,

till now, i am using this macro

Code:
[COLOR=#333333]Selection.Replace What:="SOMETHING", Replacement:="Something", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False Selection.Replace What:="SOMEthing", Replacement:="Something", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False Selection.Replace What:="SOMething", Replacement:="Something", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False[/COLOR]

i have these replaces very, very much after a time and it is very confusing, because i dont have very good control over same words etc.

You know, the replaces needs some logic so i have made "categories" of replaces. But now i d like to move on and question you if there is some better solution, in which i will be more able to read the code and know where i have to put some new replace strings.


SO


I think the best choice should be to take the find and replace strings in sheet named "replaces" for example and the routine will go row by row until empty row and in A column will be search strings, in B column replace strings. After null row, i would be happy if the string will start also at C (find string) and D column (replace string) etc. This last thing is about more categories for search... i like to have these separated by my logic. So after the routine will not find value in A, x or C, x or D, x etc, than script ends.


I tryed to add the example sheet, but i cannot now. Can send you somewhere..if you want.

-----------------------------
Also i have one question and it is if there will be some limitation. Because i have found out, that previous macro had limitations so i had to do more procedures (modules)
 
Last edited by a moderator:
Back
Top