Help me adjust this code to suit my need

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
I came across this code while searching the from the net . I need some explanation to what is happening so I can modify it to suit my needs. Why the number 809? Should that number be used for all other symbols ? Please help
Code:
[COLOR=#000000][FONT=Courier]With Me.MBStake[/FONT][/COLOR][COLOR=#000000][FONT=Courier].Text = Application.Text(Range("MBStake").Value, "[$£-809]#,##0.00;-[$£-809]#,##0.00")[/FONT][/COLOR][COLOR=#000000][FONT=Courier] 
   If Range("MBStake").Value < 0 Then[/FONT][/COLOR][COLOR=#000000][FONT=Courier] 
       .ForeColor = vbRed[/FONT][/COLOR][COLOR=#000000][FONT=Courier] 
   Else[/FONT][/COLOR][COLOR=#000000][FONT=Courier] 
       .ForeColor = vbBlack[/FONT][/COLOR][COLOR=#000000][FONT=Courier] 
   End If[/FONT][/COLOR][COLOR=#000000][FONT=Courier]End With
[/FONT][/COLOR]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The 809 is a hexadecimal value. Decoding to decimal gives 2057 which is the LCID (Locale ID) for Great Britain. So the "[$£-809]" part reads as "prefix with the Great Britain £ symbol". If you wanted to force US$ then you could use [$$-409] for example.

Hope that helps.

WBD
 
Upvote 0
Okay great. I am in ghana how do I get the Cedis symbol?

Or if not possible then how will I omit the symbol all together?
Thanks
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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