Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Round to 2 decimal places

Hello,

I am trying to round figures in a cell to the second decimal place....but I
cannot seem to do it and I cannot seem to find help in my books.

I have coe put together to put the figure in the cells, but it has many
decimal places.

This is what I have done so far and nothing:

Do While I <= 50
round(Cells(I, 3).Value,2)
I = I + 1
Loop

OR

Do While I <= 50
round(Cells(I, 3) ,2)
I = I + 1
Loop

Please help?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Round to 2 decimal places

Hi,

try this

i = 1
Do While i <= 50
Cells(i, 3).Value = WorksheetFunction.Round(Cells(i, 3), 2)
i = i + 1
Loop


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"petedacook" wrote:

Hello,

I am trying to round figures in a cell to the second decimal place....but I
cannot seem to do it and I cannot seem to find help in my books.

I have coe put together to put the figure in the cells, but it has many
decimal places.

This is what I have done so far and nothing:

Do While I <= 50
round(Cells(I, 3).Value,2)
I = I + 1
Loop

OR

Do While I <= 50
round(Cells(I, 3) ,2)
I = I + 1
Loop

Please help?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Round to 2 decimal places

Or, to stay with native VB functions, use...

Cells(i, 3).Value = Format(Cells(i, 3).Value, "#.##;;0")

--
Rick (MVP - Excel)


"Mike H" wrote in message
...
Hi,

try this

i = 1
Do While i <= 50
Cells(i, 3).Value = WorksheetFunction.Round(Cells(i, 3), 2)
i = i + 1
Loop


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"petedacook" wrote:

Hello,

I am trying to round figures in a cell to the second decimal place....but
I
cannot seem to do it and I cannot seem to find help in my books.

I have coe put together to put the figure in the cells, but it has many
decimal places.

This is what I have done so far and nothing:

Do While I <= 50
round(Cells(I, 3).Value,2)
I = I + 1
Loop

OR

Do While I <= 50
round(Cells(I, 3) ,2)
I = I + 1
Loop

Please help?



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
how do i round a quotient to specific decimal places? gissineth Excel Worksheet Functions 3 March 4th 10 03:18 AM
Round subtotals to two decimal places marcia2026 Excel Programming 0 February 16th 09 10:32 PM
Round variable to 4 decimal places achidsey Excel Programming 4 September 25th 05 02:43 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
ROUND DATA TO 2 DECIMAL PLACES roy in sunbury New Users to Excel 1 January 12th 05 03:33 AM


All times are GMT +1. The time now is 06:55 PM.

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"