View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default How to count number of Cell have Strike Through Effect & Bold as f

mike:

i just point this out because i've seen so many posts from the pros about not
having to select cells most of the time, and so i don't.
you can also do this without selecting anything. not criticizing you, i see you
help a lot of people

like i mentioned, just point this out.(promise i won't do it again<g)


Sub stantial()
Dim myRange As Range
Set myRange = Range("a1:c10") '< Alter to suit
For Each c In myRange

If c.Font.Strikethrough = True Then
strike = strike + 1
ElseIf c.Font.Bold = True Then Bold = Bold + 1
End If
Next
MsgBox (strike & " Strikethrough cells " & Bold & " Bold cells")

End Sub
--


Gary


"Mike H" wrote in message
...
Try this, it works on the active worksheet

Sub stantial()
Dim myRange As Range
Set myRange = Range("a1:c10") '< Alter to suit
For Each c In myRange
c.Select
If Selection.Font.Strikethrough = True Then
strike = strike + 1
ElseIf Selection.Font.Bold = True Then Bold = Bold + 1
End If
Next
MsgBox (strike & " Strikethrough cells " & Bold & " Bold cells")

End Sub

Mike

"Akash" 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

Akash Maheshwari