|
Format Cells as a Currency in Excel Number Formatting
This free Excel macro allows you to quickly and easily format a selection of cells in the Currency number format in Excel. This format allows you to display a number as a currency so that readers immediately know that a number is a currency and exactly what currency it is.
This macro is made to display a number in the U.S. dollar currency format but can be easily changed for any currency.
Where to install the macro: Module
Macro to Format Cells as a Currency in Excel Number Formatting
Sub Format_Cell_Currency_US_Dollar()
Selection.NumberFormat = "$#,##0.00"
End Sub
How to Install the Macro
- Select and copy the text from within the grey box above.
- Open the Microsoft Excel file in which you would like the Macro to function.
- Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.
Or For other ways to get there, Click Here.
For Excel Versions Prior to Excel 2007 Go to Tools > Macros > Visual Basic Editor
For Excel 2007 Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic
- On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.
- If the Macro goes in a Module, Click Here, otherwise continue to Step 8.
- Go to the menu at the top of the window and click Insert > Module
- Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.
- Go to Step 8.
- If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Then, at the bottom of the list that appears, double-click the ThisWorkbook text.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Go to Step 8.
- If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.
- Go to Step 8.
- Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.
- You are now ready to run the macro.
Similar Helpful Excel Resources
Hi all,
I have a spreadsheet that is use to form tables using macros. However, Iuse the same spreadhseet for all the different tables I creat and a problem arises when for one report a column will have a cost in it (want the column or cells to be formated as currency).
Then a clear that and make another report and the old cost column has a account code in it that is amde up as numbers.
Unforunately due to the previous formatting the account code is changed to currency.
The question is: what vba code can I use, for example on column "A" of a spreadhseet that will change the format of that column to what i need. Such as number, currency, text etc.
Thanks in advance
Shaunym
when i receive an excel file in an email, i open it and all numbers in the cells would be changed to curency with $ sign.
in the original file dells are formated as numbers .
does anyone encountered that issue?
please help
Hi, I would like to format a range of number as currency, but I want 0's to display as a dash "-". Is there any way to do this without having to individually format the zeros within the range?
Thanks, Ken Murray
In Excel 2007, I have a cell in Sheet1 with the named range of "currency" and data validation set to list, with currency symbols listed in the drop down. On Sheet1 I used conditional formatting to change the number format of certain cells to match the currency symbol selected in the drop down list using,for example, =currency="$" and it works fine. On Sheet2 I use the same conditional format statement and when I select a currency from the drop down on Sheet1 it will change the format once but if I select a different currency it won't change the number format. What's weird, is if not only do I set the conditional formatting to change the number format but the color of the cell as well, the cell color will change but the number format will not. Is this just a bug in excel or am I doing something wrong?
Thanks
I have a large file downloaded from SAP business warehouse and all the value are formatted in different curencies. For Example
3,705.00 EUR shows up in the cell, but that is because it has a custom cell format of #,##0.00 "EUR"
or
247,028,600.00 IDR , cell format is #,##0.00 "IDR"
I need to be able to read the "EUR" or "IDR", etc from the cell format so that I can then do a currency conversion on the numbers?
Does anyone know a way of doing this>
Hi Guys,
Is it possible to format a number (say as currency) when it is displayed on
a label control. I can't figure which property to use.
I've read answers for text boxes but these solutions don't seem to apply to
a label.
Thanks in advance.
Marc
Could someone please help me with this. It seems easy but haven't been able to do it.
I have a userform and text boxes are used to put data in a cell.
One text box will have the number 1000
And it always prompts that green arrow in the corner of cell that states convert to number, and I always lose my $ sign format, so the column doesn't sum.
Could someone please help.
Thanks Josh
Hi -
I am losing zeros after the decimal point when I convert currency and percentage numbers to text.
Ex.
Cell TAM!$AA$37 is $25.00 (number formatted as currency, two decimal places)
Formula to convert to text that has necessary formatting:
=TEXT(TAM!$AA$37,"$##.##")
Result: $25.
Any ideas on how I can keep my placeholder zeros when converting from number to text?
Thanks
Hi All,
My problem is finding the right function or macro formula to change items that I have imported from historical sports results information.
The data imported has winnings typed in as text including the dollar sign and comma. What I need to do, is convert those entries to format as Currency and be able to add the column totals.
The 2nd thing i need to do, is to remove the T in front of the numbers of finish position, when the players finish in a tie... I need this so a sort according to finish position will appear correctly.
I will attach sample of what I import:
Hope I explained this right and posted properly..
Thanks for help in advance.
Tom
|
|