PDA

View Full Version : [SOLVED:] Seriously tough question



Lucy234
03-15-2012, 09:55 AM
How to make fractions other than the 1/2, 1/4 and 2/3 already in the symbol list?

fumei
03-15-2012, 11:50 AM
1/3, 1/8, 2/8, 5/8 and 7/8 are also available as built-in symbols. Are you looking for some way to put in ANY fraction (say 143/312)? If so...say so.

Talis
03-15-2012, 12:26 PM
A simple method is to type your fraction as normal text eg 3/8. (Here '3' is the numerator and '8' is the denominator.) Next select the numerator and in the Format menu select Font and check Superscript. Select the denominator and then Format > Font check Subscript. Deselect and uncheck Subscript. Select all the fraction and choose a smaller font size than normal. This produces a fraction similar to the symbols versions although the forward slash is slightly different. If this is adequate for your needs a VBA subroutine could be created to operate on a selection and do the superscript/subscript and font size. Copy/Pasted as text the fraction reverts to normal text unlike the symbols.

Another way is to use the Microsoft Equation Editor 3.0 (in a field) but the result does not Copy/Paste into a text document.
How?...
Insert > Field...
Categories > Equations and Formulas
(At this point you may be required install the Microsoft Equation Editor - no big deal, you won't need installation disc)
Field names: > Eq
Click the Equation Editor button
Select the 3rd icon on the second row and from the drop down list select the icon for one box above another
Select each box and enter the values
Click back on your document window

Paul_Hossler
03-15-2012, 03:27 PM
What fractions are available depends on the font. Some numerical or symbol fonts have a wider selection. Especially the Unicode fonts

This is a 'general purpose' that just formats the selection



Option Explicit
'ref: http://www.techspot.com/vb/topic112097.html
'Highlight fraction x/y and run macro
Sub FractionFormat()
Dim OrigFrac As String
Dim Numerator As String, Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer
NewSlashChar = "/"
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


Sample of MS Arial Unicode

Paul

gmaxey
03-15-2012, 03:51 PM
Maybe this will help: http://gregmaxey.mvps.org/word_tip_pages/format_fractions.html

Lucy234
03-15-2012, 10:46 PM
What fractions are available depends on the font. Some numerical or symbol fonts have a wider selection. Especially the Unicode fonts

This is a 'general purpose' that just formats the selection



Option Explicit
'ref: http://www.techspot.com/vb/topic112097.html
'Highlight fraction x/y and run macro
Sub FractionFormat()
Dim OrigFrac As String
Dim Numerator As String, Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer
NewSlashChar = "/"
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


Sample of MS Arial Unicode

Paul

Thx Paul this works but it looks completely different from the built in 1/2 etc. symbols..The difference is just too obvious..

Paul_Hossler
03-16-2012, 06:21 AM
The difference is just too obvious


Well, you could turn off AutoCorrect for the 1/4, 1/2, and 3/4 and make all fractions this way

At least they'd all look alike

Paul

Lucy234
03-16-2012, 10:51 AM
Well, you could turn off AutoCorrect for the 1/4, 1/2, and 3/4 and make all fractions this way

At least they'd all look alike

Paul

I thought there was some better way. Nevermind. Ty