+ Reply to Thread
Results 1 to 2 of 2

Using VBA to change text colours

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Using VBA to change text colours

    This isn't as straight forward as the title inplies.

    I know how to set code to colour a certain set of text, however I have a document that upon selecting the event/command button a merged range (D2:S32 is created and multiple lines of text are created within. Some are words to be spoken by the user and some and directions for the user to carry out.

    it uses .value = "Text" with & vbNewLine & _ to create new lines. I thought there may be a way of defining the text section by section but the last line just overwrites all the text and turns it the colour requested.

    I would like to change directions (middle lines with (If) to red i.e. below



    “Is there anything further that I can assist you with today?”

    (If)“Yes” then answer as appropriate.

    (If)“No” then terminate call as follows:

    “Thank you very much for calling us today. Please let us know if we can be of any further assistance.”

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Using VBA to change text colours

    Please Login or Register  to view this content.
    will change all occurrences of str (assigned to (IF) in this example) to red in the cell A1.

    Note - it is case sensitive.

+ 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] Is it possible to change the colours of an Icon Set?
    By Grimace in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-22-2013, 12:39 AM
  2. How to change colours of objects?
    By muons in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2013, 04:33 AM
  3. Formatting words to change colours
    By dandavis1 in forum Excel General
    Replies: 4
    Last Post: 01-27-2010, 08:46 AM
  4. [SOLVED] automatically change cell colours
    By John Davies in forum Excel General
    Replies: 1
    Last Post: 06-30-2005, 01:05 PM
  5. [SOLVED] Change the default chart colours
    By TonyJD in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-19-2005, 10:06 PM

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