none
Excel 2010 Conditional Formating RRS feed

  • Question

  •  

    Strikethrough is only a font effect that makes text appear crossed out, having an option to highlight or apply this using Conditional Formatting can only be done by creating a Macro with Excel VBA.

    I would like to achieve the above including necessary coding .Please provide detail step by step guide                                                                                                          Dilip                                                                                                                                                          dilip_kumar04@Hotmail.com

    Thursday, August 3, 2017 1:06 PM

All replies

  • It's not true that "apply this using Conditional Formatting can only be done by creating a Macro with Excel VBA". It can be done in Excel.

    Let's say that you want to strikethrough cells in A1:A10 if they contain the word "canceled" as cell value.

    • Select A1:A10.
    • On the Home tab of the ribbon, select Conditional Formatting > New Rule...
    • Select 'Format only cells that contain'.
    • Leave the first dropdown set to 'Cell Value'.
    • Select 'equal to' from the second dropdown.
    • Enter   canceled   in the box next to it.
    • Click Format...
    • Activate the Font tab.
    • Tick the Strikethrough check box.
    • Click OK.
    • Click OK again.

    If you prefer a macro:

    Sub SetStrikethrough()
        Selection.FormatConditions.Add( _
            Type:=xlCellValue, _
            Operator:=xlEqual, _
            Formula1:="=""canceled""").Font.Strikethrough = True
    End Sub
    

    The macro assumes that you select the range to be used before running it.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Thursday, August 3, 2017 2:36 PM
  • Hi dbah,

    Did the suggestion from Hans work for you?

    If it did, I would suggest you mark the reply as answer to close this thread.

    If not, please feel free to let us know your current issue.

    Regards,

    Tony


    Help each other

    Monday, August 14, 2017 8:06 AM
  • Hi dbah,

    I can see that after creating this thread, you did not follow up this thread again.

    this thread is still open.

    If your issue is solved now then I suggest you to update the status of this thread and post the solution here and mark it as an answer.

    if the issue is still exist then I suggest you to refer the suggestion provided by the community members. it can solve your issue.

    if still you have any further question regarding the above question then let us know about that.

    we will try to provide further suggestion to solve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 22, 2017 7:49 AM
    Moderator