ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prevent changing a fraction (https://www.excelbanter.com/excel-programming/441157-prevent-changing-fraction.html)

Len

Prevent changing a fraction
 
Hi,

In Excel or VBA function, after formatting cell to fraction, is there
anyway to stop Excel from automatically changing a fraction from what
you type in a field? and do not convert to text ( ie put an inverted
comma before fraction or press space bar before fraction ) as this
fraction will be used for computation later

E.g.
1) key-in 5/35 and hit "Enter" key will become 1/7 fraction value
2) key-in 5/5 and hit "Enter" key will become 1 whole number

Do not change the original fraction as follows:-

1) key-in 5/35 and hit "Enter" key will maintain as 5/35 fraction
value
2) key-in 5/5 and hit "Enter" key will maintain as 5/5 fraction value

Regards
Len




ozgrid.com

Prevent changing a fraction
 
The only way I can think of is enter your fraction and custom format the
cell as "5/35"

Doesn't account for any value change, though.



--
Regards
Dave Hawley
www.ozgrid.com










"Len" wrote in message
...
Hi,

In Excel or VBA function, after formatting cell to fraction, is there
anyway to stop Excel from automatically changing a fraction from what
you type in a field? and do not convert to text ( ie put an inverted
comma before fraction or press space bar before fraction ) as this
fraction will be used for computation later

E.g.
1) key-in 5/35 and hit "Enter" key will become 1/7 fraction value
2) key-in 5/5 and hit "Enter" key will become 1 whole number

Do not change the original fraction as follows:-

1) key-in 5/35 and hit "Enter" key will maintain as 5/35 fraction
value
2) key-in 5/5 and hit "Enter" key will maintain as 5/5 fraction value

Regards
Len





Len

Prevent changing a fraction
 
Hi Dave,

Thanks for your suggestion

I try to format cell as text and then reformat it to value, that cell
still doesn't account for any value



Regards
Len


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com