ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   insert 1/3 as fraction (https://www.excelbanter.com/excel-programming/428097-insert-1-3-fraction.html)

Steve

insert 1/3 as fraction
 
Howdee all.
Hope everyone is getting along.

I'm trying to insert a 1/3 character in some code that I'm using for a macro.
While I could easily type one, forward slash, and three, (1 / 3), I'd rather
use the option as in alt + 0188, where I get a ¼ form of the fraction.

I've found the one third fraction in the symbol map, but I see no key
strokes to access it, for entry into the code for my macro.
I.e., on the character map, it shows as U + 2153, Vulgar fraction one third.

So, my question is:

Does anyone know of keystrokes that will allow me to access this character?


Thank you.






Steve

got it....
 
I found what I was looking for.
Thank you.
turns out if you want to access "fancier" characters, you have to use
chrW(&Hn)
where the n = the vulgar fraction value.
In my case the n = 2153, so I set it to:
chrW(&H2153) and I get one third exactly as I desire.
I'll definitely be testing others in that list too.
Best.

"Steve" wrote:

Howdee all.
Hope everyone is getting along.

I'm trying to insert a 1/3 character in some code that I'm using for a macro.
While I could easily type one, forward slash, and three, (1 / 3), I'd rather
use the option as in alt + 0188, where I get a ¼ form of the fraction.

I've found the one third fraction in the symbol map, but I see no key
strokes to access it, for entry into the code for my macro.
I.e., on the character map, it shows as U + 2153, Vulgar fraction one third.

So, my question is:

Does anyone know of keystrokes that will allow me to access this character?


Thank you.






Rick Rothstein

insert 1/3 as fraction
 
This will reference the 1/3 character that you want...

ChrW(8531)

For example...

Range("A1").Value = ChrW(8531)

--
Rick (MVP - Excel)


"Steve" wrote in message
...
Howdee all.
Hope everyone is getting along.

I'm trying to insert a 1/3 character in some code that I'm using for a
macro.
While I could easily type one, forward slash, and three, (1 / 3), I'd
rather
use the option as in alt + 0188, where I get a ¼ form of the fraction.

I've found the one third fraction in the symbol map, but I see no key
strokes to access it, for entry into the code for my macro.
I.e., on the character map, it shows as U + 2153, Vulgar fraction one
third.

So, my question is:

Does anyone know of keystrokes that will allow me to access this
character?


Thank you.








All times are GMT +1. The time now is 05:34 PM.

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