Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The macro below will round up all numeric values to 0 decimal places. You can either change the
values to formulas that use the original value (what it does now), or change the value to the rounded-up value. To do that change myC.FormulaR1C1 = "=ROUNDUP(" & myC.Value & ",0)" 'myC.Value = Application.WorksheetFunction.RoundUp(myC.Value, 0) to 'myC.FormulaR1C1 = "=ROUNDUP(" & myC.Value & ",0)" myC.Value = Application.WorksheetFunction.RoundUp(myC.Value, 0) HTH, Bernie MS Excel MVP Sub RoundUpSheet() Dim myC As Range On Error GoTo NoFormulas For Each myC In Cells.SpecialCells(xlCellTypeFormulas, 1) If InStr(1, myC.FormulaR1C1, "ROUNDUP") = 0 Then _ myC.FormulaR1C1 = "=ROUNDUP(" & Mid(myC.FormulaR1C1, 2, Len(myC.FormulaR1C1)) & ",0)" Next myC NoFormulas: Resume DoValues DoValues: On Error GoTo NoConstants For Each myC In Cells.SpecialCells(xlCellTypeConstants, 1) myC.FormulaR1C1 = "=ROUNDUP(" & myC.Value & ",0)" 'myC.Value = Application.WorksheetFunction.RoundUp(myC.Value, 0) Next myC NoConstants: End Sub "Daddy Dool" wrote in message ... How can I roundup the whole sheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
round up #.#0 and #.#5 | New Users to Excel | |||
Round Function for Entire Sheet | New Users to Excel | |||
round down? | Excel Discussion (Misc queries) | |||
How do I ROUND() round off decimals of a column dataset? | Excel Worksheet Functions | |||
round up ? | Excel Worksheet Functions |