Replace based on combobox value

M

Mike

I currently have a combobox that shades in cells based on
a combobox value. Each cell has a formula that inputs a
cells value based on another cells value unless the value
is "0". If the value is "0" it inputs "SPARE" but if the
cell is shaded via the combobox, I want the input for
a "0" value to be "N/A".

How is this done if possible? Can I do the formula based
on the cell shading or does it have to be set to the
combobox.

Any help is appreciated,

Mike
 
D

Dave Peterson

Is all this work done by code?

If yes, then maybe you can just check the values and the shading (does shading
mean fill color?).

Option Explicit
Sub testme01()
With ActiveSheet
If .Range("a1").Value = 0 Then
If .Range("b1").Interior.ColorIndex = 6 Then
.Range("b1").Value = "N/A"
Else
.Range("b1").Value = "SPARE"
End If
Else
'not sure what happens here
End If
End With

End Sub

I used a .colorindex of 6. Probably not what you're using.

(But I'm not sure if I understood the question.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top