+ Reply to Thread
Results 1 to 6 of 6

Replace and delete certain text in the selected cells

  1. #1
    Registered User
    Join Date
    12-24-2019
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Question Replace and delete certain text in the selected cells

    Hello,

    please could anybody help me fix the following code?

    Please Login or Register  to view this content.
    The code is meant to 1) replace certain text in the selected cells, 2) delete certain text in the selected cells if it's at the beginning and 3) delete certain text in the selected cells if it's at the end - all without affecting the char level formatting.

    When I run it, it says:

    Please Login or Register  to view this content.
    and it highlights the following part:

    Please Login or Register  to view this content.
    Please bear in mind that I don't know anything about VBA programming. I haven't been able to get in touch with the person who wrote this code.

    Thank you very much in advance.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Replace and delete certain text in the selected cells

    Don't think it works as you expect though...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-24-2019
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Re: Replace and delete certain text in the selected cells

    jindon: Thank you for your help. Much appreciated! What you wrote seems to work perfectly, but the first part that is meant to replace certain text by another ("FindChars", "ReplaceChars") doesn't work and I can see now the code is wrong :/

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Replace and delete certain text in the selected cells

    The first part should be
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-24-2019
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Re: Replace and delete certain text in the selected cells

    Thank you very very very much! It works like a charm now.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Replace and delete certain text in the selected cells

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Replace text for selected cells only
    By Hall in forum Excel General
    Replies: 5
    Last Post: 01-02-2021, 05:11 PM
  2. [SOLVED] VBA - delete text b/w first and second space in a string of text - apply to selected range
    By mgerner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2018, 03:52 PM
  3. [SOLVED] Search and replace - but only on selected cells?
    By timsharp03 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2016, 05:36 AM
  4. macro for replace and delete text chain in several cells
    By alesiracer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2014, 06:58 PM
  5. Loop backwards through selected range - delete entire row from selected cells
    By scottbass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 09:21 AM
  6. Find and Replace in selected cells only
    By Davidns in forum Excel General
    Replies: 5
    Last Post: 03-20-2012, 05:05 AM
  7. Replies: 2
    Last Post: 08-28-2011, 02:39 AM

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