+ Reply to Thread
Results 1 to 5 of 5

Find and Replace for longer strings?

  1. #1
    Registered User
    Join Date
    01-14-2009
    Location
    Earth
    MS-Off Ver
    2007
    Posts
    43

    Find and Replace for longer strings?

    Now and then I run into the problem where the string I am searching for or replacing with is too long and either won't fit in the text field or allow me to replace it. How can I do this? I've read a little about the `replace` function but it doesn't look like it will do what I am after at this moment.

    Example of what I am trying to do... I am trying to replace a section of old HTML with a section of new HTML. The HTML below is only part of the text in each cell:

    OLD HTML
    Please Login or Register  to view this content.
    NEW HTML
    Please Login or Register  to view this content.
    Last edited by flipjarg; 02-28-2012 at 07:13 PM. Reason: Solved

  2. #2
    Registered User
    Join Date
    01-14-2009
    Location
    Earth
    MS-Off Ver
    2007
    Posts
    43

    Re: Find and Replace for longer strings?

    Why doesn't this work?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find and Replace for longer strings?

    Try putting Option Explicit at the top of the module. What happens?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-14-2009
    Location
    Earth
    MS-Off Ver
    2007
    Posts
    43

    Re: Find and Replace for longer strings?

    ... when I did that, I found out that I need to do better error checking (especially when copying code)... the following code works... with correct variable names THROUGHOUT the code:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find and Replace for longer strings?

    Good job !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1