+ Reply to Thread
Results 1 to 7 of 7

VB Macro - Find & Replace Characters not working

  1. #1
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    VB Macro - Find & Replace Characters not working

    All,

    I created a macro below but I received a syntax error. I created a macro to find the characters &quot and replace it with the " character for the active spreadsheet . Below is the macro coding.


    Sub FindDataErrorMacro()

    ActiveSheet.Range("a2").CurrentRegion
    Cells.Replace What:=""” Replacement:=""", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False


    End Sub


    I appreciate the help.

    Haleakala 17

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: VB Macro - Find & Replace Characters not working

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: VB Macro - Find & Replace Characters not working

    Oh, forgot. Please use Code Tags around your code ... otherwise you are breaking a forum rule ... and we both get in trouble from the moderators. Probably you more than me

  4. #4
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: VB Macro - Find & Replace Characters not working

    TMShucks,

    I appreciate the coding, it worked perfectly? I should have given you all my coding in the beginning because I also want to find and replace the following values below in addition to the coding you created.

    Find value: / replace with: /

    Find value: & replace with: &

    Find value: ' replace with: '

    Find value: > replace with: >

    Find value: &lt; replace with: <

    Find value: ¿ replace with: ..

    Question, how can I add this find and replace values to the current coding you created?

    Haleakala17

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: VB Macro - Find & Replace Characters not working

    Maybe:

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    07-28-2012
    Location
    Morgantown, WV
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: VB Macro - Find & Replace Characters not working

    TMShucks,,

    Thank you so much sir, this is perfect. I see how you created the Dim vArrayF, this is very useful.

    Haleakala17

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: VB Macro - Find & Replace Characters not working

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] find and replace to not replace characters found as wildcards
    By sabutler4 in forum Excel General
    Replies: 4
    Last Post: 07-03-2013, 06:48 PM
  2. [SOLVED] Find and Replace Macro not working for sheet Referance in formula
    By Lotrking1010 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-31-2012, 08:15 AM
  3. Find/Replace macro not working on all relevant cells.. Hidden formatting?
    By heather1209 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2012, 09:24 AM
  4. Find and replace characters.
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-04-2012, 02:31 PM
  5. Replies: 7
    Last Post: 03-03-2008, 11:48 AM

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