Sub FmtFraction()
Dim sFraction() As
String
Dim sChar As String
'Check if a fraction is selected
'and if not show a warning and exit
If InStr(Selection, "/") =
False Then
MsgBox "No fraction
selected!", _
vbCritical, "Format
Fraction"
Exit Sub
End If
'Define a new slash
character
sChar = ChrW(&H2044)
'Split the original
fraction at the slash character
sFraction = Split(Selection, "/")
'Reformat the fraction
using super and subscript
With Selection
.Font.Superscript =
True
.TypeText
Text:=sFraction(0)
.Font.Superscript =
False
.TypeText Text:=sChar
.Font.Subscript =
True
.TypeText
Text:=sFraction(1)
.Font.Subscript =
False
End With
End Sub