Forum Discussion
Cell formatting
You have to add the text to each section:
The custom format that I applied is
[Red]General "USD";[Green]General "USD";[Blue]General "USD"
Thak you for your reply. I knew that the code worked if you add a text to each section.
However, I cannot display the information I'd like, using the information from MS Support site. Please have a look https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5 and https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68. As you can see, a custom format code can have up to 4 sections, from which the last is used for text. Please use the provided example ([Blue]#,##0.00_);[Red](#,##0.00);0.00;"sales "@), and tell me if you can see any "sales" text next to any type of value. In my understating, the "sales" text should have been automatically added before or after (?) any type of value. On the other hand, it may be that the "sales" text appears (next to cell value) only if in that cell is a text, not a value.
- HansVogelaarJul 14, 2024MVP
The fourth section is for text values only, not for numbers. The @ in that section stands for the text value as entered. The text in quotes is added to the cell value.
In the screenshot above, you can see in the formula bar that the active cell contains the text Weekly, but because of the custom format, it is displayed as sales Weekly in the cell.