Round to 2 decimal places

P

petedacook

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?
 
M

Mike H

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.
 
R

Rick Rothstein

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top