Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Zero Decimal Places

I have the following
sqmrc1 = Range("K1").Value / 1000
Which is used later
Cells(ActiveCell.Row, ActiveCell.column + 1).Value = sqmrc1

I have found how to divide sqmrc1 but how do I make the result to zero
decimal places?

Thanks Blue


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Zero Decimal Places

Two possible answers depending on how much accuray you want to maintain.

format(sqmrci, "0")

or

round(sqrmc1, 0)

Hope this helps...

"Blue" wrote:

I have the following
sqmrc1 = Range("K1").Value / 1000
Which is used later
Cells(ActiveCell.Row, ActiveCell.column + 1).Value = sqmrc1

I have found how to divide sqmrc1 but how do I make the result to zero
decimal places?

Thanks Blue



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Zero Decimal Places

Jim thanks for the reply

I have tried various ways of using Format(sqmrc1, "0") but get an error
message or result is zero. How/where do I attached
Format(sqmrc1, "0") to sqmrc1 = Range("K1").Value / 2

Thanks Blue



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Zero Decimal Places

Cells(ActiveCell.Row, ActiveCell.column + 1).Value = Format(sqmrc1,"0")

or

ActiveCell.Offset(0,1).Value = Format(sqmrc1,"0")

or

ActiveCell(1,2).Value = Format(sqmrc1,"0")


"Blue" wrote in message
k...
Jim thanks for the reply

I have tried various ways of using Format(sqmrc1, "0") but get an error
message or result is zero. How/where do I attached
Format(sqmrc1, "0") to sqmrc1 = Range("K1").Value / 2

Thanks Blue





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Zero Decimal Places

John,

Cells(ActiveCell.Row, ActiveCell.column + 1).Value = Format(sqmrc1,"0")

Did the trick, Thanks

Blue


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
Decimal Places JHL Excel Discussion (Misc queries) 4 April 24th 07 06:44 PM
Decimal Places Tafmutt Excel Discussion (Misc queries) 2 March 14th 07 09:22 PM
Subtracting two 2-decimal place numbers gives result 13-decimal places? [email protected] Excel Worksheet Functions 5 March 12th 07 10:38 PM
Max decimal places SusieQ Excel Discussion (Misc queries) 1 July 13th 05 07:57 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM


All times are GMT +1. The time now is 08:11 PM.

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"