• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Formula To Do/Undo 'Strike-Through'

I have a drop-down list of things that we sell.
Sometimes due to unavoidable delays a particular item may not be available and so it becomes necessary to take the item off the list in which case i would like to use a 'strike-through' on the item (in the drop-down list) to indicate that a particular item is currently not available and later on take off the 'strike-through' when the item becomes available.
Thank you for a suitable solution.
God bless.
 
@chirayu

The OP wants entries in a drop down menu to be stroked through if the corresponding data is not present. when it is present it should not be done so..
 
Hi James,
It can be done using VBA with a small code

e65b111b-4efb-4158-ab17-a87a3e7abdd9 00_00_08-00_00_15.gif

Here is the code

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, cell As Variant
Set rng = ActiveSheet.Range("B2:B5")
For Each cell In rng
If (cell.Value = "No") Then
cell.Offset(0, -1).Font.strikethrough = True
Else
cell.Offset(0, -1).Font.strikethrough = False
End If
Next cell
End Sub
 
@Ranjith kumar

What you are doing can be done with simply Cond. Formatting. But OP wants if say Computer is not available it should be strike out in Drop down list.

I don't think that is possible in data validation through normal means.

Regards,
 
Not possible in dropdown as far as In know - unless you use a data validation list as its cell based
 
Back
Top