Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DG DG is offline
external usenet poster
 
Posts: 46
Default Number Format

I have a macro with the following formula

OnProdOrd = (Cells(x, 10) - Cells(x, 11) / Cells(x, 9))

I'll use x = 1 for the example

Cells(1,10) = 10
Cells(1,11)= 0
Cells(1,9)= 0.5
The problem is that in Cell(x,9) the value is 0.5. But the program must be
rounding to 1 or making it an integer because OnProdOrd = 10 when it should
be 20 (10 - 0)/0.5.

How do I correct this?

Dan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Number Format

Hi

Just a little formula error (look at the parenthesises):


OnProdOrd = (Cells(x, 10) - Cells(x, 11)) / Cells(x, 9)

Regards,

Per

"DG" skrev i meddelelsen
...
I have a macro with the following formula

OnProdOrd = (Cells(x, 10) - Cells(x, 11) / Cells(x, 9))

I'll use x = 1 for the example

Cells(1,10) = 10
Cells(1,11)= 0
Cells(1,9)= 0.5
The problem is that in Cell(x,9) the value is 0.5. But the program must be
rounding to 1 or making it an integer because OnProdOrd = 10 when it
should be 20 (10 - 0)/0.5.

How do I correct this?

Dan


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
Replace million-billion number format to lakhs-crores format Sumit Excel Discussion (Misc queries) 1 December 9th 05 04:58 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
Number format based on number format of another cell in another workbook Rob Excel Programming 9 January 9th 05 04:30 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM


All times are GMT +1. The time now is 06:28 AM.

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

About Us

"It's about Microsoft Excel"