+ Reply to Thread
Results 1 to 6 of 6

Underline part of text after/ before exact character in a cell

  1. #1
    Registered User
    Join Date
    11-17-2019
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Underline part of text after/ before exact character in a cell

    Hi everyone,

    Sorry that I am new in VBA. Is there a way to underline the characters in-between "after" and "vs" words and must contain specific text ("price increase"), and then produce the expected results below?

    Expected results:

    after price increase of ~0.1% - 0.15% vs others in Year 2020:
    ~234% after ~6% - 7% price increase vs others in Year 2019: ~7.5% after price increase of ~1% - 9.9% (avg. ~5%) vs previous price released from Oct 2019 to May 2020 and 1st launch in Oct 2019

    Prices of 45 stocks were revised after ~4% - 6% price reduction vs previous price released in May 2020 after ~1% - 7% price increase vs 1st launch in Oct 2019 and price reduction of ~1.2% - 2% vs 1st launch in Oct 2019 resulting from adding 6% discount

    Thanks for your advice in advance!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    8,057

    Re: Underline part of text after/ before exact character in a cell

    One way I suppose...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere.....
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember......Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    11-17-2019
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Underline part of text after/ before exact character in a cell

    Thanks for your prompt reply, sintek. But I found that the second phrase in cell F11 in your Excel file has not an underline (the example was as follows) after running the macro. And when I tried to apply this, I will get a Type Mismatch error due to the limit of string length 255. Is there any solution regarding these two issues? Thanks again.

    ~234% after ~6% - 7% price increase vs others in Year 2019: ~7.5% after price increase of ~1% - 9.9% (avg. ~5%) vs previous price released from Oct 2019 to May 2020 and 1st launch in Oct 2019

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    8,057

    Re: Underline part of text after/ before exact character in a cell

    If this does not solve then you will need jindons RegEx skills...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 05-21-2020 at 09:27 AM.

  5. #5
    Registered User
    Join Date
    11-17-2019
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Underline part of text after/ before exact character in a cell

    Thank you so much, Sintek. This means a lot to me.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    8,057

    Re: Underline part of text after/ before exact character in a cell

    Glad I could help...Tx for rep +

+ 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] How to insert a different numbers of character in a part of a text?
    By Lavrikas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2020, 04:21 AM
  2. Underline a specific part of a text string (inc formulas) using VBA.
    By Oriya in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-06-2019, 05:56 AM
  3. [SOLVED] Find exact text in exact cell but on any sheet?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2017, 02:59 PM
  4. [SOLVED] underline text within the same cell
    By aarona in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2017, 08:42 PM
  5. [SOLVED] Exact comparison including bold / italics / underline
    By qjawaid in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-30-2014, 07:28 PM
  6. Extract text left and right of character part 2
    By stuartm4h in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-01-2013, 07:12 AM
  7. Replies: 3
    Last Post: 05-20-2010, 09:54 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