View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Replace based on combobox value

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.)

Mike wrote:

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


--

Dave Peterson