LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BenCoo
 
Posts: n/a
Default Format numberformat Single

Hello,

In a sheet a have the following function :

Public Function feetAndInchToMeters(feet, inch) As Single
Dim sngFeet As Single
Dim sngInches As Single
Dim sngMeter As Single
Dim feet2Meter As Single
Dim inch2Meter As Single

sngFeet = feet
sngInches = inch
feet2Meter = 0.3048
inch2Meter = 0.0254
ActiveCell.NumberFormat = "0.00 \m"
sngMeter = (sngFeet * feet2Meter) + (sngInches * inch2Meter)

feetAndInchToMeters = sngMeter
End Function

when I asign the function to a cell and insert the values 5 and 3 I get the
number 1,6002 in sted of 1,60 m what is wrong whith my function ?

Thanks in advance,

Benny


 
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
Conditional Format Not Working KMH Excel Discussion (Misc queries) 0 December 22nd 05 05:32 PM
Strange Format changes Dan Wilson Excel Worksheet Functions 5 March 15th 05 02:49 AM
Keep custom format in new worksheet Buddy Excel Discussion (Misc queries) 2 March 14th 05 10:03 AM
How to format a date to a different format Laura Excel Discussion (Misc queries) 1 March 5th 05 09:59 PM
When I select "format cells", the format dialog box does not disp. Andy S. Excel Worksheet Functions 2 November 23rd 04 03:49 AM


All times are GMT +1. The time now is 04:20 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"