View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How to count number of Cell have Strike Through Effect & Bold as font style.

The UDF's count cells with strikethrough or bold formatting.

What has changing the value from 80 to 60 got to do with the above?

Maybe the bold or strikethrough is created by Conditional Formatting?

More detail please before we "rectify".


Gord

On Thu, 28 Jun 2007 08:36:01 -0000, Akash Maheshwari
wrote:

Hi Gord,

Its working fine but every time a value is entered in the related
range I need to refresh the formula...

It should be done autometically. Then whats the need of the macro.

it should be in the below mentioned way.

For Example Suppose we have:

Value in Cell B1 :20
Value in Cell C1 :20
Value in Cell D1 :20
Value in Cell E1 :20

and in Cell A1 there is a sum total =SUM(B1:E1)

Output would be 80

Now suppose i delete the value in E1

The output of cell A1 would automatically be 60. I dont have to
refresh the Cell A1.

But in the macro provided by you, i need to refresh the cell A1 every
time.

This needs to be rectified.

Awaiting for you mail.

Thanks

Akash Maheshwari



On Jun 28, 1:56 am, Gord Dibben <gorddibbATshawDOTca wrote:
Akash

Here are a couple of UDF's you could use.

Function CountBold(rg As Range) As Long
'originally posted by Ron Rosenfeld
Dim c As Range
For Each c In rg
CountBold = CountBold - c.Font.Bold
Next c
End Function

Function CountStrike(rg As Range) As Long
'originally posted by Ron Rosenfeld
'revised by Gord Dibben
Dim c As Range
For Each c In rg
CountStrike = CountStrike - c.Font.Strikethrough
Next c
End Function

Usage is................=CountBold(range)

Gord Dibben MS Excel MVP

On Wed, 27 Jun 2007 13:04:01 -0000,AkashMaheshwari

wrote:
Hi,


I have data in Column D:BG


Mostly Cell have Strike Through Effect & Bold as font style.


How can we count those cells which are having strike Through Effect in
it.
How can we count those cells which are having Bold Font Style in It.


Awaiting for your reply.


Thanks


AkashMaheshwari