Closed Thread
Results 1 to 2 of 2

Find & Replace Loop Help Needed

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Atlanta, GA, USA
    MS-Off Ver
    Excel 2016
    Posts
    46

    Find & Replace Loop Help Needed

    I'm trying to write a macro that searches for the string " Total" in a column of text and once it finds that text, replaces it with "" and performs a variety of functions around that cell including adding rows above and below and formatting cells around it before searching for the next iteration of " Total". The code works fine until there are no more instances of " Total" to be found, at which point the macro stops and I receive the error "Run-time error '91': Object variable or With block variable not set."

    I've searched online for a solution to why this isn't working in my macro, but can't find the right combination of code to make my macro work. The pertinent part of my code is below. (The lines showing just a period are used to dramatically shorten the code.)

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Find & Replace Loop Help Needed

    Welcome to the Forum. Pls take some minutes to read forum rules because,unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula to find and replace where needed
    By maymano in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-07-2013, 02:09 PM
  2. Help Needed with Find and Replace Macro
    By e30325i in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 02:49 PM
  3. VBA Find and replace loop help needed
    By susanbarbour in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2012, 08:43 AM
  4. Excel 2007 : Find and replace loop
    By chrisrabkin in forum Excel General
    Replies: 1
    Last Post: 10-18-2011, 05:58 PM
  5. FIND and REPLACE characters needed
    By Peter C in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-08-2006, 05:20 PM

Tags for this Thread

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