S
sephilpot
Hello.
I am trying to create a Macro that I can fun in PowerPoint to
automatically format fractions for me. I currently have a macro set
up in Word but when I copied it over to PowerPoint, it did not work.
I am pasting below what I am currently using in Word. Can someone
please correct this for me so that I may use it in PowerPoint? I do
not konw enough about Microsoft Visual Basic to do this myself.
Sub FmtFraction()
Dim OrigFrac As String
Dim Numerator As String
Dim Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer
NewSlashChar = ChrW(&H2044)
OrigFrac = Selection
SlashPos = InStr(OrigFrac, "/")
Numerator = Left(OrigFrac, SlashPos - 1)
Denominator = Right(OrigFrac, Len(OrigFrac) - SlashPos)
With Selection
.Font.Superscript = True
.TypeText Text:=Numerator
.Font.Superscript = False
.TypeText Text:=NewSlashChar
.Font.Subscript = True
.TypeText Text:=Denominator
.Font.Subscript = False
End With
End Sub
Thanks a million!
Sue Ellen
I am trying to create a Macro that I can fun in PowerPoint to
automatically format fractions for me. I currently have a macro set
up in Word but when I copied it over to PowerPoint, it did not work.
I am pasting below what I am currently using in Word. Can someone
please correct this for me so that I may use it in PowerPoint? I do
not konw enough about Microsoft Visual Basic to do this myself.
Sub FmtFraction()
Dim OrigFrac As String
Dim Numerator As String
Dim Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer
NewSlashChar = ChrW(&H2044)
OrigFrac = Selection
SlashPos = InStr(OrigFrac, "/")
Numerator = Left(OrigFrac, SlashPos - 1)
Denominator = Right(OrigFrac, Len(OrigFrac) - SlashPos)
With Selection
.Font.Superscript = True
.TypeText Text:=Numerator
.Font.Superscript = False
.TypeText Text:=NewSlashChar
.Font.Subscript = True
.TypeText Text:=Denominator
.Font.Subscript = False
End With
End Sub
Thanks a million!
Sue Ellen