Windings Symbol Color

zaska

Well-known Member
Joined
Oct 24, 2010
Messages
1,046
Hi all,

Is there any way to change the color of symbols(windings2Fomat) example a Star using VBA depending on the values in cell "A1"

Value Color

1 1 st star yello

2 1 st star yellow and second star red

3 1 st star yello , 2nd star red , 3rd star green

Maximum Five Values Only

Thank you
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Select the Cell with the "Wingdings" , run code Enter colour code for each "WDG"as asked for "WDGS" Coloured accordingly.
Code:
[COLOR="Navy"]Sub[/COLOR] MG28May13
[COLOR="Navy"]Dim[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Message, Title, Default, MyValue
Message = "Enter a value between 1 and 50"
Title = "Colour Stars"
Default = "1"
[COLOR="Navy"]For[/COLOR] n = 1 To Len(ActiveCell)
    MyValue = InputBox(Message, Title, Default)
    Range("a1").Characters(n, 1).Font.ColorIndex = MyValue
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Thank you

I am looking for coloring different stars in the same cell.

I meant for the first star " Yellow" , Second star " Red" etc...

Maximum there will be only 5 Stars in Each Cell

Your Code is turming all the Stars in a Cell to Single Color ...Which is selected through message box.


Thank you
 
Upvote 0
Zaska, you should try this before you dismiss it.
 
Upvote 0
It worked first time for me. Did you put five different colour codes into the InputBox?

What version of Excel are you using?
 
Upvote 0
As Ruddles says you need to Insert a different Number each time the InputBox shows.
Mick
 
Upvote 0
I am using Excel 2003 ..I tried the code and it worked when i gave five different values each time in the message box.

I Think since the No of Stars are limited i.e 5 we can assign different colors or a two color Filling in all the Five Stars Contained in a single cell , without having the choice of message box.

What i mean to say is.

If there is only One Single star in a cell then it should be Yellow.

If there are Two stars in a Cell then Yellow and Red.

Hope i have clearly expressed what i wish to learn.

Thank you
 
Upvote 0
Try this: select the range then run the macro

Code:
Sub colours()
Dim i As Long, r As Range, c
c = Array(6, 3, 4, 5, 7)
For Each r In Selection
    For i = 1 To WorksheetFunction.Min(5, Len(r.Value))
        r.Characters(i, 1).Font.ColorIndex = c(i - 1)
    Next i
Next r
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,158
Members
452,892
Latest member
yadavagiri

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