Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default countif strikethrough

How do I write a formula to count a cell if the font is strikethrough? I can
really make the conditional format to be any type of font or cell change -
whatever is easiest for the formula. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default countif strikethrough

Here is a User Defined Function (UDF) that will do what you want:

Public Function CountStrike(r As Range) As Long
Application.Volatile
CountStrike = 0
For Each rr In r
If rr.Font.Strikethrough = True Then
CountStrike = CountStrike + 1
End If
Next
End Function


User Defined Functions (UDFs) are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To use the UDF from Excel:

=CountStrike(A1:A100) just like a normal Excel function

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx
for specifics on UDFs

--
Gary''s Student - gsnu201001


"ericahughes" wrote:

How do I write a formula to count a cell if the font is strikethrough? I can
really make the conditional format to be any type of font or cell change -
whatever is easiest for the formula. Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Strikethrough lightbulb Excel Discussion (Misc queries) 5 April 4th 23 02:11 PM
Sorting a spreadsheet by strikethrough? Nicol Excel Discussion (Misc queries) 1 November 4th 09 04:43 PM
Row and Column Strikethrough Craig Wilson Excel Discussion (Misc queries) 1 June 27th 07 02:20 PM
Can you do strikethrough in excel? Snooky Excel Discussion (Misc queries) 2 January 10th 06 01:28 PM
Strikethrough on Excel. How? Jerry Baritone Excel Worksheet Functions 1 January 3rd 05 09:55 PM


All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"