PDA

View Full Version : [SOLVED:] Colours based on drop down



CuriousGeorg
12-17-2014, 07:42 AM
Good Afternoon,

this is a basic request that Im not certain is possible but want to hope it is. Various websites have a dropdown box which changes the colour scheme of the website and I was wondering if I could replicate this in Excel somehow.

For example I have a basic dashboard that has a black background mainly for impact however some people dont like the black and would prefer a pastel colour say. If i changed the background the fonts etc wouldnt be visable.

IS there something i could code that if the drop down options were say "Original, Pastel, Printable", that the whole dashboard could change colour?

Kenneth Hobs
12-17-2014, 08:57 AM
The easiest way to see how it is done is to record a macro. Otherwise, please post a short example file so that we can best help.

SamT
12-17-2014, 10:17 AM
Depending on how many colors and Themes you are talking about, use an IF...Then...ElseIF statement or a Select case Statement to assign different values to some variables, then format the cells using those variable's values.

This may help

Sub showColorIndexNums()
Dim i As Long
Worksheets.Add before:=Sheets(1)
[A1].Value = "Color"
[B1].Value = "Index Number"
ActiveSheet.Name = "ColorIndex"
For i = 2 To 58
Range("A" & i).Interior.ColorIndex = i - 2
Range("B" & i).Value = i - 2
Next i
ActiveSheet.[B:B].EntireColumn.AutoFit
End Sub

CuriousGeorg
12-18-2014, 02:12 AM
cant believe i didnt think of a basic macro!!

however I also like your Idea SamT thanks to you both. Ill have a bit of a play with both ideas and see which one is the better idea. I think i may have the macros fire based on the drop down option.

if dropdown = "1" then color1,
etc