+ Reply to Thread
Results 1 to 3 of 3

Replace function missing strings in a merged range?

  1. #1
    Registered User
    Join Date
    05-27-2014
    Posts
    16

    Replace function missing strings in a merged range?

    Sup,
    I've recently been making a macro in visual basic that loops through all my excel files and replaces an old company name to a new company name and It's working great, well except for one thing... It always misses one string in the file and it leaves me with 90% of the file corrected. I think that the string might be a part of a merged range so Range.Find is not able to find it.
    I was suggested to use this code:
    Please Login or Register  to view this content.
    Because that's the code that is generated when using the replace function in MS Excel 2010, but I keep getting syntax errors?

    Any help is extremely appreciated.
    Thanks!
    Sincerely, Glitches.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Replace function missing strings in a merged range?

    Without seeing the file in question we can only make informed guesses. However in the code you show you have two full stops .. before the Replace instruction. Try removing one of them.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-27-2014
    Posts
    16

    Re: Replace function missing strings in a merged range?

    Never mind, I figured it out...
    I was trying to use "Address.value = replace...." but I was suppose to use "Address.replace..."
    Thanks anyways!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA function for min, max range in Strings
    By gorelordz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2014, 09:40 PM
  2. Multiple Find and Replace to replace a list of strings
    By WalterP34 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2011, 07:41 PM
  3. Custom Function: Count number of strings in range?
    By milz326 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2010, 04:04 PM
  4. Passing multiple strings to variable in Replace Function
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2006, 01:10 PM
  5. Batch Replace function for Large strings
    By R Avery in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2005, 06:06 PM

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