fractions in forms & cells (not DATES & Decimals)

G

Guest

How can I guaranteed that fractions ("5/16" etc) are displayed rather than
dates or decimals in my user forms, Excel cells, and Word bookmarks?

I have tried many things, including formating the Excel cells (Format
Cells...), using Format(data,"# ??/??"), using Application.Text(Cstr(data),
"##/##"), .Numberformat = "# ??/??" and I still have problems.

What I find is that I keep getting Decimals or Dates instead of fractions.
The problem happens both in Excel Cells and when the data in those cells is
transfered to forms generated via Word VBA.

I've resorted to formating everything as text, but that seems to be a poor
solution given Excel's ability to deal with fractions.

Thanks for any tips,
-Tony
 
N

NickHK

Tony,
Using this:

With Range("A1")
.Value = 0.5
.NumberFormat = "# ??/16"
MsgBox .Text
End With

I see "8/16".

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top