Macro VBA number formatting

andyspa

New Member
Joined
May 23, 2024
Messages
4
Office Version
  1. 365
Hello!

I have this number formattin, which doesn't work for negative numbers. Anyone can can write a macro for me in order to make it possible?

Excel Formula:
[>=1000000] € #,##0.0,,"M";[<1000000] € #,##0.0,"K";General

Thanks million in advance!

Cheers,
andy
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I used a Conditional formatting to solve the issue

Brown Bag Lunch Ideas.xlsm
MN
25FormattedValue
26€ 1.3M1254789
27-€ 2.1M-2148725
28€ 0.00
29€ 145.8K145777
30-€ 895.0K-895000
Number Formatting
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M26:M30Expression=M26<=0textNO


A view of the Conditional Formatting
1716477974098.png

1716478001111.png
 
Upvote 0
Thanks a lot Jeffrey! Is there a way to move the "-" before the numbers instead of the euro symbol?
 
Upvote 0
You should have tried playing around with the number formatting. You can't break anything
[<=-1000000]€* -#,##0.0,,"M";[<=-1000]€* -#,##0.0,"K";€* 0.0
 
Upvote 0

Forum statistics

Threads
1,223,706
Messages
6,173,998
Members
452,542
Latest member
Bricklin

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