+ Reply to Thread
Results 1 to 4 of 4

Replace special characters macro not looping through cells

  1. #1
    Registered User
    Join Date
    07-12-2015
    Location
    Melbourne,Australia
    MS-Off Ver
    2007
    Posts
    14

    Question Replace special characters macro not looping through cells

    Hi,

    I have a macro that will ask the user to open a workbook, select a specific sheet and then ideally it will search all the cells in that workbook to find special characters. When it finds the characters it asks the user if they want to replace it or not, if no it will continue on and if yes it will replace it and continue on.

    Issues;
    A) It asks the user to confirm the replacing of each special character it finds in 1 cell, and once done with that cell it stops. It will not go to another cell until I run it again (and there are no special characters to replace in the previous cell). So I need it to loop through the entire worksheet rather than stop after its job is done on one cell.

    I am also unsure how it will handle characters I have selected to not replace once it starts looping? Is there a way to ensure it only does one loop through the worksheet?

    B) It seems to skip Cell A1 for some reason, not a huge deal as long as it does Cell A1 eventually, just odd.

    Please Login or Register  to view this content.
    Thanks for the help,
    Mattyfaz

  2. #2
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Replace special characters macro not looping through cells

    You need to keep looping until you find the first special character or there are no special characters on the sheet

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    07-12-2015
    Location
    Melbourne,Australia
    MS-Off Ver
    2007
    Posts
    14

    Re: Replace special characters macro not looping through cells

    Quote Originally Posted by mehmetcik View Post
    You need to keep looping until you find the first special character or there are no special characters on the sheet
    Thanks for the help but I am getting the below error:
    Run-Time error '91':
    Object variable or With block variable not set

    Any advice?
    Please Login or Register  to view this content.
    Also, will this skip something if I selected that I do NOT want to change that character?

  4. #4
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Replace special characters macro not looping through cells

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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. [SOLVED] Macro to replace special characters, keep list of replacements or confirm before replacing
    By mattyfaz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-14-2015, 09:31 PM
  2. [SOLVED] Replace special characters with Space
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2014, 11:38 AM
  3. [SOLVED] Find and replace special characters (unicode)
    By joevan1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2013, 06:05 AM
  4. Macro to replace European characters with non "special" English characters?
    By johanna0507 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 09:13 AM
  5. search and replace special characters
    By jmhultin in forum Excel General
    Replies: 2
    Last Post: 10-14-2009, 12:07 PM
  6. Replies: 1
    Last Post: 05-25-2006, 11:29 AM
  7. How do I find replace special characters?
    By zzapper in forum Excel General
    Replies: 1
    Last Post: 06-27-2005, 02:05 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