writing fractions

K

Kat

Word automatically creates common fractions such as 1/2, but how do I turn
say turn 5/6 in to a fraction when I'm typing in Word? I need to write up a
fraction work sheet for some primary school students and my fractions need to
look like fractions. I'm sure there is an easy way of doing this, so if
anyone knows it and can pass it on that would be fantastic.
 
S

Summer

You can try this simple macro:

To use the macro, simply position the insertion point at the end of the
fraction you typed, and then run it. If you want to change the slash
character used, change the character assigned to the NewSlashChar variable.
Sub FmtFraction()
Dim OrigFrac As String
Dim Numerator As String, Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer

NewSlashChar = "/"

Selection.MoveLeft Unit:=wdWord, count:=3, Extend:=wdExtend
OrigFrac = Selection
SlashPos = Instr(OrigFrac, "/")
Numerator = Left(OrigFrac, SlashPos - 1)
Denominator = Right(OrigFrac, Len(OrigFrac) - SlashPos)
Selection.Font.Superscript = True
Selection.TypeText Text:= Numerator
Selection.Font.Superscript = False
Selection.TypeText Text:= NewSlashChar
Selection.Font.Subscript = True
Selection.TypeText Text:= Denominator
Selection.Font.Subscript = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top