ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I apply a formula to #s already typed in a series of cells (https://www.excelbanter.com/excel-worksheet-functions/26784-how-do-i-apply-formula-s-already-typed-series-cells.html)

redinBR

How do I apply a formula to #s already typed in a series of cells
 
I have a spreadsheet where I already have several hundred numbers typed in as
whole numbers. Is there a way to apply a formula to the whole section that
will round each of the pre-typed numbers to the nearest thousand.

I know how to do it using =ROUND on a cell by cell basis, but that would
take me forever.

Please help!

Don Guillett

one way
Sub placformulaetoround()
For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row)
c.Value = Round(c / 1000, 0) * 1000
Next c
End Sub
--
Don Guillett
SalesAid Software

"redinBR" wrote in message
...
I have a spreadsheet where I already have several hundred numbers typed in

as
whole numbers. Is there a way to apply a formula to the whole section

that
will round each of the pre-typed numbers to the nearest thousand.

I know how to do it using =ROUND on a cell by cell basis, but that would
take me forever.

Please help!





All times are GMT +1. The time now is 12:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com