Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Font options

555 views
Skip to first unread message

John Pryor

unread,
Jun 28, 2000, 3:00:00 AM6/28/00
to
Tell me, can I REALLY not use small caps in Excel 2K?

--
John Pryor FBII
www.dorset-arms.co.uk
The Dorset Arms at Withyham
Sussex, England

The Best Food in Sussex - Probably!

Pat Finegan

unread,
Jun 28, 2000, 3:00:00 AM6/28/00
to
Nor in XL97. Word offers much greater control over fonts than Excel, but
you can format each character separately to, in effect, generate small
caps. Select Tools => Macro => Visual Basic Editor, then Insert => Module
and paste the following code. Assign an accelerator key if desired. Then
select any range, run the macro, and it will detect those cells with text
and assign small caps in standard proper case format.

Sub SmallCaps()
Dim o As Object
Dim sCap As Integer, _
lCap As Integer, _
i As Integer
Dim testStr As String
For Each o In Selection
With o
If Application.IsText(.Value) Then
lCap = .Characters(1, 1).Font.Size
sCap = Int(lCap * 0.85)
'Small caps for everything.
.Font.Size = sCap
.Value = UCase(.Value)
testStr = .Value
'Large caps for 1st letter of words.
testStr = Application.Proper(testStr)
For i = 1 To Len(testStr)
If Mid(testStr, i, 1) = UCase(Mid(testStr, i, 1)) Then
.Characters(i, 1).Font.Size = lCap
End If
Next i
End If
End With
Next o
End Sub


--
Posted via CNET Help.com
http://www.help.com/

matthew....@gmail.com

unread,
Dec 21, 2012, 1:02:57 PM12/21/12
to
Fantastic macro...The only change is that I use "Int(lCap * 0.75)". I have a Proper Case macro I found a while back, this rounds out most of my macro-based formatting needs on excel.
0 new messages