Google Grupper har inte längre stöd för nya Usenet-inlägg eller -prenumerationer. Historiskt innehåll förblir synligt.
Dismiss

Font options

555 visningar
Hoppa till det första olästa meddelandet

John Pryor

oläst,
28 juni 2000 03:00:002000-06-28
till
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

oläst,
28 juni 2000 03:00:002000-06-28
till
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

oläst,
21 dec. 2012 13:02:572012-12-21
till
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 nya meddelanden