+ Reply to Thread
Results 1 to 8 of 8

How to bold specific characters in a cell using VBA or replace function in excel?

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Perth
    MS-Off Ver
    Excel 2010
    Posts
    208

    How to bold specific characters in a cell using VBA or replace function in excel?

    Hi guys,

    I have a table where each cell contains number of specific codes and I am trying to find a way to bold only those codes in those cells.

    I have attached the sample workbook below.

    I already know that it is not possible to do this using the excel formula.

    however, VBA or other excel functions that I can perhaps use to achieve this?

    Many thanks in advance.

    Kind regards,

    Jin
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    I think this will do what you want
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

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

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    jjin

    This should do
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Perth
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    Thank you mikerickson and Jindon. It both works. much appreciated.

  5. #5
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Perth
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    Hi jindon,

    Your code does what I want to achieve however it is very slow when i applied it to my worksheet where there are more than 6,000 rows.

    Is there any way I can apply the code without freezing my screen for long time?

    Thank you in advance.

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

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    Quote Originally Posted by jjin View Post
    Your code does what I want to achieve however it is very slow when i applied it to my worksheet where there are more than 6,000 rows.

    Is there any way I can apply the code without freezing my screen for long time?
    Normally changing cell format would take time and I can only think of setting ScreeUpdating property to false in the beginning and set it back to true at the end..

  7. #7
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Perth
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    Thank you. I will try with screenupdating code Hope it will make the code faster. Many thanks.

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: How to bold specific characters in a cell using VBA or replace function in excel?

    Rich text in cells (differently formatted characters in the same cell) is a slow process in Excel.

+ 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. Replies: 8
    Last Post: 10-21-2014, 03:03 PM
  2. [SOLVED] Need to 'Bold' & 'Underline specific characters in a field
    By KatieKat440 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-19-2013, 03:57 PM
  3. Find and replace function based on first 2 characters of cell only
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2012, 02:36 AM
  4. [SOLVED] How can I replace 2 of 5 characters within an cell in MS Excel?
    By Barb R. in forum Excel Formulas & Functions
    Replies: 32
    Last Post: 09-06-2005, 07:05 AM
  5. How can I replace 2 of 5 characters within an cell in MS Excel?
    By Myrna Larson in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 04:05 AM
  6. How can I replace 2 of 5 characters within an cell in MS Excel?
    By pmhall in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. How can I replace 2 of 5 characters within an cell in MS Excel?
    By pmhall in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 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