View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default How can I count BOLD letters in a cell?

I have never seen the syntax (ByRef rCell As Excel.Range).
Can you please expand on the 'Excel.Range' data type
Thanks
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"JE McGimpsey" wrote in message
...
ONe wa:

Public Function BoldChars(ByRef rCell As Excel.Range) As Variant
Dim nCount As Long
Dim i As Long
With rCell
If .Cells.Count 1 Then
BoldChars = CVErr(xlErrRef)
Else
For i = 1 To .Characters.Count
nCount = nCount - .Characters(i, 1).Font.Bold
Next i
BoldChars = nCount
End If
End With
End Function


In article ,
Duddly Dummy <Duddly wrote:

I need to create 2 cells from one cell based on Bold Type. The Bold type
characters (name) will be copied into one new cell with the rest of the
characters (registration number, color(bay/chestnut) and dates) in a 2nd
new
cell. The original cell can contain up to 28 alpha/numeric characters.
How
can I count the number of Bold Type characters in a cell? I will be
working
with several hundred original mixed cells.

EX:NAME ahr#1234567 1989 (with NAME being bold type.)

Thanks in advance for your help!!