Results 1 to 1 of 1

Thread: Finad and Replace - how to read values from sheet

  1. #1

    Question Finad and Replace - how to read values from sheet



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi All,

    till now, i am using this macro

    Code:
    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

    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 Zack Barresse; 2013-02-10 at 08:06 AM. Reason: Added CODE tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •