View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DontKnowWhatImDoing DontKnowWhatImDoing is offline
external usenet poster
 
Posts: 1
Default ComboBox programming not working

If anyone can help?!

Problem I have is that my combobox has values and if you
select the lowest value (12) first then any larger value
it works fine, but if you select a larger value fisrt then
a lower value second, nothing happens. Here is the code I
have.

Private Sub ComboBox1_Change()

If ComboBox1.Value = 12 Then Range
("A8:G49,K8:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 18 Then Range
("A8:G10,K8:Q10").Interior.ColorIndex = 0 And _
Range("A11:G49,K11:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 20 Then Range
("A8:G11,K8:Q11").Interior.ColorIndex = 0 And _
Range("A12:G49,K12:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 24 Then Range
("A8:G13,K8:Q13").Interior.ColorIndex = 0 And _
Range("A14:G49,K14:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 30 Then Range
("A8:G16,K8:Q16").Interior.ColorIndex = 0 And _
Range("A17:G49,K17:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 42 Then Range
("A8:G22,K8:Q22").Interior.ColorIndex = 0 And _
Range("A23:G49,K23:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 54 Then Range
("A8:G28,K8:Q28").Interior.ColorIndex = 0 And _
Range("A29:G49,K29:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 72 Then Range
("A8:G37,K8:Q37").Interior.ColorIndex = 0 And _
Range("A38:G49,K38:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 84 Then Range
("A8:G43,K8:Q43").Interior.ColorIndex = 0 And _
Range("A44:G49,K44:Q49").Interior.ColorIndex = 15 Else
If ComboBox1.Value = 96 Then Range
("A8:G49,K8:Q49").Interior.ColorIndex = 0

End Sub