Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Format as fraction - why doesn't this work?

why doesn't this work?

format(1.5,"0 ??/??")

should return a string "1 1/2", it seems. Instead, it returns "2 ??/??"

What am I missing?

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Format as fraction - why doesn't this work?

Mike,

Apparantly, Format doesn't do fractions, but this does:

Application.Text(1.5, "# ??/??")

HTH,
Bernie
MS Excel MVP


"Mike Weaver" wrote in message
...
why doesn't this work?

format(1.5,"0 ??/??")

should return a string "1 1/2", it seems. Instead, it returns "2 ??/??"

What am I missing?

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Format as fraction - why doesn't this work?

not sure the "text" answer allows math

why not just format cell as fraction :

Selection.NumberFormat = "# ??/??"

"Bernie Deitrick" wrote:

Mike,

Apparantly, Format doesn't do fractions, but this does:

Application.Text(1.5, "# ??/??")

HTH,
Bernie
MS Excel MVP


"Mike Weaver" wrote in message
...
why doesn't this work?

format(1.5,"0 ??/??")

should return a string "1 1/2", it seems. Instead, it returns "2 ??/??"

What am I missing?

Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Format as fraction - why doesn't this work?

The worksheet function TEXT takes a number and returns a formatted text string.
Selection.Numberformat would work fine, if the variable were actually being stored in the
spreadsheet and not manipulated in VBA.

HTH,
Bernie
MS Excel MVP


"Vacation's Over" wrote in message
...
not sure the "text" answer allows math

why not just format cell as fraction :

Selection.NumberFormat = "# ??/??"

"Bernie Deitrick" wrote:

Mike,

Apparantly, Format doesn't do fractions, but this does:

Application.Text(1.5, "# ??/??")

HTH,
Bernie
MS Excel MVP


"Mike Weaver" wrote in message
...
why doesn't this work?

format(1.5,"0 ??/??")

should return a string "1 1/2", it seems. Instead, it returns "2 ??/??"

What am I missing?

Thanks in advance






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Format as fraction - why doesn't this work?

Thanks! That is exactly what I needed.

Mike

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mike,

Apparantly, Format doesn't do fractions, but this does:

Application.Text(1.5, "# ??/??")

HTH,
Bernie
MS Excel MVP


"Mike Weaver" wrote in message
...
why doesn't this work?

format(1.5,"0 ??/??")

should return a string "1 1/2", it seems. Instead, it returns "2 ??/??"

What am I missing?

Thanks in advance





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text fraction to fraction format brownti via OfficeKB.com Excel Worksheet Functions 1 February 1st 08 02:38 PM
How to convert fraction format to text format ...... Epinn New Users to Excel 3 November 19th 06 01:19 AM
VBA won't format into fraction damorrison Excel Discussion (Misc queries) 11 March 12th 06 10:37 PM
fraction format Horatio J. Bilge Excel Discussion (Misc queries) 10 April 19th 05 01:20 AM
Improper fraction format? David Excel Worksheet Functions 1 April 4th 05 01:04 PM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"