+ Reply to Thread
Results 1 to 3 of 3

Colorizing part of text in a string variable

  1. #1
    Registered User
    Join Date
    02-07-2020
    Location
    Lillehammer, Norway
    MS-Off Ver
    365
    Posts
    2

    Question Colorizing part of text in a string variable

    Hi good People!

    I am looking for a way to colorize text in a textvariable. I am listing a range of events in a textbox containing a timestamp and an eventname. The Source also has information of the soure for the event, either phone, email or chat. I would like to put individual colors on the text depending of the Source. Or even better, include a symbol in the string with customized color for each event type.

    I fill the textbox simply like this:

    Please Login or Register  to view this content.

    Any way my wish could come through?

    Best regards
    Prarne
    Last edited by jeffreybrown; 03-04-2020 at 04:41 PM. Reason: Please use code tags!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Colorizing part of text in a string variable

    Prarne

    You can't format a string but you can format the text displayed in the textbox.

    Can you post some sample data and indicate the formatting you would want to apply?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-07-2020
    Location
    Lillehammer, Norway
    MS-Off Ver
    365
    Posts
    2

    Re: Colorizing part of text in a string variable

    Hi Norie - thanks for rapid response!

    The data consists of a simple table With Events, timestamp and Source, eg. 'Printer problem', '04.03.2020 15:12:23', 'Phone'

    The routine takes the 12 latest rows and lists them simply in the textboks using a fixed font (Courier New Times) like this:

    04.03.2020 20:28:09 - Printer problems
    04.03.2020 20:26:43 - Network issues
    04.03.2020 13:08:17 - Permission denied

    The preferred solution would be to replace the dash between the timestamp and the event text with a bullet point colorized dependent of the Source Field, either 'Phone', 'Mail' or 'Chat' (green,orange or yellow). Alternatively the text or background could be colorized, but that could be rather painfull to look at :-).

    The dash will always be in the same position in each line of text (pos 22)

    Best regards
    Prarne

+ 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 create a self-adjusting formula to extract variable sized part of a string
    By bnevena in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-03-2018, 03:54 PM
  2. Storing complex text string into variable. Text string contains html or xml code.
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2015, 04:54 AM
  3. Replies: 2
    Last Post: 03-18-2015, 07:30 PM
  4. Replies: 3
    Last Post: 02-17-2015, 11:53 PM
  5. [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
  6. Match text in A1 to a part of a text string in B1 and enter data D1
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 10:16 PM
  7. How to get set of chars from a string to a variable. Part II
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-08-2010, 04:19 PM

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