Apply Round Formula via VBA to 12 columns containing both formulas and values

CCantara

New Member
Joined
Oct 27, 2015
Messages
3
Hi Folks,

I've had great luck with the members of this site, so here goes...

I have a data sheet where 12 columns contain a dynamic number of rows/cells where some are formulas and some are hardcoded values. This file is submitted each month. I would like a macro to insert the "Round" function to 2 decimal places into all the cells in these 12 columns only.

Specifically, the macro would:
1) add "=round(value,2)" to cells without formulas and greater than 0, and not "",
2) skip cells where there is already a round function included, and
3) add "round(formula,2)" to cells with other formulas.

If there's any chance someone could help me with this, I would be most appreciative.

Thanks.

CCantara
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
question would be , why do you need to round, you can apply a format to two decimals without having to touch anything
 
Upvote 0
question would be , why do you need to round, you can apply a format to two decimals without having to touch anything

This worksheet is used to upload data into an SQL Database. Data comes in from many sources, some manipulated by formulas, some not. SQL will not recognize the cell formats, only the underlying data. It must be stripped first.

Thanks for your time, though!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top