While some fractions are automatically available, we can also 'create' less-commonly used fractions by using Windows Character Map, Utility, Microsoft Word's Symbol Library, or Microsoft Office's Auto-Correct capability.
Some fractions are available as ASCII characters (¼, ½ and ¾) and a limited number of others are available within Unicode's extended character set (⅓, ⅔, ⅛, ⅜, ⅝ and ⅞). When it becomes necessary to produce less common fractions that are not so readily available, Unicode characters give us that ability by constructing the fraction's numerator and denominator with superscripts and subscripts.
The numerators start wth ASCII code ¹ (0×185), ² (0×178) and ³ (0×179). After that, Unicode characters for ⁴ to ⁹ (H2074 to H2079) and ⁰ (H2070) should be put to use. The denominators can be generated with the Unicode characters ₀ to ₉ (H2080 to H2089). While a standard forward slash may be sufficient, I prefer the Unicode Fraction Slash (⁄ or H2044). This article will demonstrate a universal method for all Windows programs, an MS Word specific method using the Symbol library and the use of MS Office’s AutoCorrect Proofing tool to replace typed fractions with styled replacements.
A. Windows’ Character Map Utility
- Open the Character Map utility found in All Programs ► Accessories ► System Tools.
- Build your fraction by choosing each superscript or subscript digit and clicking Select.
- When the fraction is complete click Copy, then move to your target Office application and paste the completed fraction into your document.
B. Word’s Symbol Library
- MS Word’s Symbol library (Insert ► Symbol ► More Symbols) holds all of the ASCII and Unicode characters for creating your own fractions on-
- The image above shows the location of the denominators, the fraction slash and most numerators. The ¹, ² and ³ numerators are located much closer to the top of the symbol library.
C. MS Office’s AutoCorrect
- While the capability is there to produce stylized number display for virtually any fraction, generating more than a few of these quickly becomes tedious and a lengthy document which includes many variations will become unwieldy. Office's AutoCorrect functionality
can reduce this to simply typing the digits required but even this becomes a chore after entering more than a few fraction Replace: and With: values into the Proofing tools'
AutoCorrect ► Replace as you type.
I've written the following macro to quickly populate Office Proofing ► AutoCorrect ► Replace as you type entries with all of the fractions for any given denominator. Office's Proofing, AutoCorrect entries are common to all Office applications so that entry into one application (such as Excel) will have the same entry available in other Office applications with Proofing tools (such as Word). Due to subtle differences in the way Word VBA and Excel VBA handle things like the Application.InputBox command, I've chosen Excel as the preferred method of distribution. There is a sample macro-enabled workbook available through a download link toward the end of this article but you can also paste the following into Excel's Visual Basic Editor by tapping Alt+F11. Once the VBE opens, use the pull-down menus to Insert ► Module and paste this code into the new pane titled something like Book1 -Module1 (Code).
Dim i As Integer, l As Integer, n As Integer, d As Integer
Dim iNumer As Integer, iDenom As Integer, sOrig As String
Dim s As String, sNumer As String, sDenom As String
iDenom = Abs(Application.InputBox(prompt:="Please supply a “ & _
denomonator to create fractions for:", _
Title:="Denomonator for AutoCorrect Fractions", Type:=1))
If CBool(iDenom) Then
On Error Resume Next
For i = 0 To iDenom
n = i
d = iDenom
If n > 1 And n < d Then
For l = (d / 2) To 2 Step -1
If Not CBool(n Mod l) And Not CBool(d Mod l) Then
n = n / l
d = d / l
sOrig = n & Chr(47) & d
sNumer = vbNullString
For l = 1 To Len(Format(n, "0"))
s = Mid(Format(n, "0"), l, 1)
Select Case s
sNumer = sNumer & Chr(185)
Case 2, 3
sNumer = sNumer & Chr(176 + Int(s))
Case 0, 4, 5, 6, 7, 8, 9
sNumer = sNumer & ChrW(&H2070 + Int(s))
sDenom = vbNullString
For l = 1 To Len(Format(d, "0"))
s = Mid(Format(d, "0"), l, 1)
sDenom = sDenom & ChrW(&H2080 + Int(s))
Application.AutoCorrect.AddReplacement sOrig, _
sNumer & ChrW(&H2044) & sDenom
- Tap Alt+Q to return to your worksheet when you have that pasted, then
Alt+F8 to open the Macros dialog and Run the macro.
Supply a number for the fraction’s denominator and click OK. The corrected fractions and their original typed entries will be listed in the active worksheet starting at J2.
- Once the macro has completed, typing your fraction will result in its automatic conversion. Any AutoCorrection can be reversed to its originally typed value by tapping
Ctrl+Z (Undo) immediately after the correction has been made.
If for any reason you wish to remove the fraction AutoCorrect entries, there is a remove macro supplied with the sample workbook as well.
There are a few points to make about the fractions and the macro.
· These stylized fractions are for labeling purposes. They cannot be used in calculations.
· Each fraction created is resolved down to its lowest denominator. For example: ²⁴⁄₆₀ is created as ²⁄₅.
· While these entries will be available to any Office application with Proofing tools, each Office application reads its Proofing tools into memory
the first time it is used. In other words, if Publisher has already been used at least once in the current computer session, the computer will have
to be restarted before the new AutoCorrect entries are available to Publisher.