+ Reply to Thread
Results 1 to 9 of 9

Format part of a string

  1. #1
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Format part of a string

    Hi all,

    I am trying to build a Gantt chart schedule and am now looking to partially format cells in a range. This is the code I found on web:

    Please Login or Register  to view this content.
    This seems to do a trick, but... In any given row I may want to format first 3 or 8 characters, depending on product name length. There is a helper column (range L2:L8) that does LEN and returns the number of characters to format.

    How do I achieve this?

    By the way, I attach a dummy example for you to look at.
    Attached Files Attached Files

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

    Re: Format part of a string

    If you want to change the font color up to first space then
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    Cairo, Egypt
    MS-Off Ver
    MS Office 2013
    Posts
    76

    Re: Format part of a string

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Format part of a string

    Absolutely perfect! Off topic, how do I make it red text bold?

    Thanks!

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    Cairo, Egypt
    MS-Off Ver
    MS Office 2013
    Posts
    76

    Re: Format part of a string

    Please Login or Register  to view this content.

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

    Re: Format part of a string

    In my case.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Format part of a string

    Thanks both! Very neat!

  8. #8
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Format part of a string

    Oops, got excited too early. On the actual workbook I am getting "Unable to get the Characters property of the Range class" error. Why is that?

  9. #9
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Format part of a string

    Actually I have managed to adapt Jindon's code.

+ 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 change 1) part of string, 2) the order of characters inside a string, 3) format
    By Karl Gustaf Karsten in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2015, 11:51 AM
  2. [SOLVED] How Do I Find and Return a String When Only Part of that String is Known?
    By Foamy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2014, 05:31 AM
  3. [SOLVED] Can I remove the first part of a string of text and keep the second part?
    By Whoop92 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-12-2014, 07:44 PM
  4. [SOLVED] Find a string by VBA Regular Expression and replace a part of that string
    By taps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2013, 11:08 AM
  5. Looking for Part of a String
    By arussell1983 in forum Excel General
    Replies: 6
    Last Post: 02-06-2010, 09:17 PM
  6. part of string
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-17-2005, 08:25 AM
  7. [SOLVED] Use part of string
    By Tempy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2005, 07: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