Partial text colour in a string variable

QuestionBaker

Board Regular
Joined
Apr 12, 2019
Messages
106
Office Version
  1. 365
Platform
  1. Windows
I am generating a string variable by joining multiple values (some are taken from cells, others are just typed).
I am sending this string to a text box in power point.
Is it possible to partially colour the string (part green, part red, part blue)? I have an indentifier which can tell me what colour that subset of string has to be.
my string variable is being made somethig like this
VBA Code:
str_var = ""
while till_next_cell_in_row_is_not_empty
    str_var = str_var & ws.Cells(i, j) & " has  " & ws.Cells(i, j+1) & " dogs."
    till_next_cell_in_row_is_not_empty = next cell in the row
Wend
send str_var to ppt text box
in each row, ws.Cells(i, j+2) will either be "R", "G" or "B", and based on the that value, that particular line should be coloured red, green or blue
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Variables don't have properties like colour. You would have to colour the characters in the shape in powerpoint, not the variable.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top