Mimicking Small Caps in Excel

by Allen Wyatt
(last updated April 29, 2017)

3

Conrad would like to mimic the "small caps" capability of Word within Excel. The only way he can think to do this is to develop a macro that steps through every character in a cell. If the character is lowercase and 11 pt, then the macro should change the character to uppercase 9 pt. If the character is uppercase (or not a letter), then it should not be affected. Problem is, Conrad doesn't know how to affect the formatting of individual characters in the cell in the manner described.

When using a macro to affect only certain characters within the cell, it is good to remember that each cell has its own Characters collection that can be accessed and modified. Each element in the collection represents, as you might expect, a single character in the cell.

This allows us to put together a macro that examines what is currently in the cell, and if the character is currently lowercase, convert just that character to uppercase and reduce that character's font size.

Sub SmallCaps()
    Dim rCell As Range
    Dim sWords As String
    Dim sCharacter As String
    Dim x As Long

    'go through each cell in selection
    For Each rCell In Selection
        'Don't want to work on formulas
        If Not rCell.HasFormula Then
            sWords = rCell.Value 'Get the cell contents
            For x = 1 To Len(sWords) 'Act on each letter
                sCharacter = Mid(sWords, x, 1)
                If sCharacter >= "a" And sCharacter <= "z" Then
                    'sCharacter is a lowercase letter
                    With rCell.Characters(Start:=x, Length:=1)
                        'Decrease the font size by 2
                        .Font.Size = .Font.Size - 2
                        'Make character uppercase
                        .Text = UCase(sCharacter)
                    End With
                End If
            Next
        End If
    Next
End Sub

This macro does its work on whatever cells are selected when it is run. It checks to make sure the cell doesn't contain a formula (formulas are skipped), and then it makes any modification to lowercase characters in the cell.

There are drawbacks to using a macro such as this, and you should be aware of them. The biggest drawback is that it actually modifies what is in the cells. When it is done, the cells will contain all uppercase text, even though the formatting may make it look like small caps. This means that you may have problems when you later run the macro a second time, and Excel's proofing tools (such as the spell checker) won't work on words that are all uppercase. (Excel can, however, be configured to still spell check such words.)

Because of the drawbacks, you may want to take an entirely different approach—change the font you use for the cells in which you want small caps. If you search the web for a "small caps fonts" (without the quote marks) you should be able to find many candidates, and a good number of them are available for free. Here is one site that may have something you like:

https://www.fontsquirrel.com/fonts/list/tag/small%20caps

Just download the font you want (from this or any other reputable source) and install it on your system. When you restart Excel, the font should be available for formatting cells. Cells formatted to use such a font would show text as small caps, even though the actual cell contents are a mixture of upper- and lowercase.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (653) applies to Microsoft Excel 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Adding Fonts To the Context Menu

Context menus appear when you right-click on different items in Word. These menus can be edited to add items, such as common ...

Discover More

Creating a Calendar Tool

Word has no way to add a calendar to your document that can be used for inserting dates, but you can add a calendar tool that ...

Discover More

Inserting Multiple Graphics in a Document

Word allows you to easily place graphics in a document. Placing one or two graphics is easy, but placing many graphics in a ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Underlining Text in Cells

Want a quick way to add some underlines to your cell values? It's easy using the tools on the Home tab of the ribbon.

Discover More

Hash Marks Displayed Instead of Cell Contents

Have you ever entered information in a cell only for it to appear as hash marks? This tip explains why this happens, how you ...

Discover More

Understanding Underlines

Excel provides a variety of underlining styles you can use when you need to underline information within a cell. Here's what ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 4?

2017-05-01 10:08:44

Jeaux

I LOVE this tip. Thank you.


2017-04-30 00:26:32

Theo Deed

Beautiful.


2017-04-29 12:25:56

Sheryl Lucas

Using a small caps font Is an OK solution if the file will only be viewed on one computer. Be aware, though, that if the file is opened on other computers that don't have that font installed, the file will display in said computer's default font.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.