Macro based on cell format?

phrogg108

New Member
Joined
May 11, 2011
Messages
3
Is there a way to do create a macro based on the format of the cell? Here is what I am trying to do:

I would like to "find all cells that are formatted as currency", multiply the current price that is in the cell by 1.04 and then =ROUND(cell_in_question,1). So, round to the nearest whole number.

Trying to do a price increase, then round it to the nearest whole number, but we also have descriptions of parts on the worksheets and I don't want to hit those cells. Just the ones with the prices in them.

If it's possible to do it to the whole workbook, I would love to know how to do that too.

I have never created a macro before of ANY kind, so be gentle. :)

Thanks for any info in advance!!!!!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Just try this formula on every cell....

=IF(ISERROR(ROUND(A1*1.04,1)),"",ROUND(A1*1.04,1))

Result....
If the cel is a nr, it will be calculated, if its a desc, it will be blank
 
Upvote 0
I tried that, but it is blanking my cells. They are formatted as currency to two places. Not sure if that is important or not....
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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