#1
|
|||
|
|||
Macro to toggle strikethrough?
Trivial in Word, but this has completely eluded me in Excel, for some reason —
I use strikethrough to keep track of values accounted for elsewhere and frequently strike and un-strike cells in the process. Unlike Word, Excel buries the format control a bit, making it difficult to access and apply/unapply. I need a simple VBA action/macro that will toggle strikethrough on and off on a selected cell. This could be done with a cell style, but as I apply it to a variety of formatted cells, it needs to work without affecting any other style setting. Ad(thanks)vance! |
#2
|
|||
|
|||
The following is already built into Excel :
Code:
CTRL / 5 |
#3
|
|||
|
|||
...oh. Quite a few 'experts' have failed to have that answer on tap. Thanks! |
#4
|
|||
|
|||
I would be interested in the VBA code for this, so that I can integrate it in macros. Thx.
|
#5
|
||||
|
||||
A whole cell:
Code:
Range("A1").Font.Strikethrough = True Code:
Range("A1").Characters(Start:=3, Length:=4).Font.Strikethrough = True To toggle: Code:
Range("A1").Font.Strikethrough = Not Range("A1").Font.Strikethrough |
#6
|
|||
|
|||
Thanks.
Code:
ActiveCell.Font.Strikethrough = Not ActiveCell.Font.Strikethrough |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toggle on & off Allow in-cell editing -or- a macro to do this | Covert Codger | Outlook | 7 | 03-05-2024 02:44 PM |
Macro for zooming toggle | dovel | Word | 2 | 07-31-2020 02:32 PM |
Superscript directly above strikethrough | bowlfreak_not | Word | 1 | 07-04-2018 03:36 PM |
Macro to toggle outline level | Jennifer Murphy | Word VBA | 3 | 01-22-2014 11:22 PM |
Macro to toggle outline level | Jennifer Murphy | Word VBA | 0 | 07-08-2013 08:20 AM |