Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text to Fraction
I copied some fraction from internet which may be in text format, but there
is no single quote in front of them. How can I change them to fractions or numbers by using VBA code. Could somebody please help. Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text to Fraction
Hi alan,
Really need to see a sample of the fractions. If it looks like this 1/2 then it is easy. See example below. Otherwise not so easy. celValue = ActiveCell dividePos = InStr(1, celValue, "/") 'Position of division sign dividend = Val(Left(celValue, dividePos - 1)) divisor = Val(Mid(celValue, dividePos + 1)) result = dividend / divisor Regards, Ossiemac "AlanW" wrote: I copied some fraction from internet which may be in text format, but there is no single quote in front of them. How can I change them to fractions or numbers by using VBA code. Could somebody please help. Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text to Fraction
Maybe you don't need VBA:
Format an empty cell as number. EditCopy. Select your fractions. EditPaste special, check Multiply. Depending on what your fractions look like, they may also be converted to dates, so be careful. -- Kind regards, Niek Otten Microsoft MVP - Excel "AlanW" wrote in message ... |I copied some fraction from internet which may be in text format, but there | is no single quote in front of them. How can I change them to fractions or | numbers by using VBA code. Could somebody please help. | | Thanks |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text to Fraction
<check Multiply
Make that: check Add !! -- Kind regards, Niek Otten Microsoft MVP - Excel "Niek Otten" wrote in message ... | Maybe you don't need VBA: | | Format an empty cell as number. EditCopy. Select your fractions. EditPaste special, check Multiply. | | Depending on what your fractions look like, they may also be converted to dates, so be careful. | | -- | Kind regards, | | Niek Otten | Microsoft MVP - Excel | | "AlanW" wrote in message ... ||I copied some fraction from internet which may be in text format, but there || is no single quote in front of them. How can I change them to fractions or || numbers by using VBA code. Could somebody please help. || || Thanks | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to convert fraction format to text format ...... | New Users to Excel | |||
How do I change fraction to fraction characters? | Excel Worksheet Functions | |||
fraction | Excel Worksheet Functions | |||
fraction | Excel Discussion (Misc queries) | |||
How do I change a text fraction. eg 1 1/2 into a decimal number, . | Excel Worksheet Functions |