Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:53:21+00:00 2026-06-17T18:53:21+00:00

This is really bugging me as it seems pretty illogical the way it’s working.

  • 0

This is really bugging me as it seems pretty illogical the way it’s working.

I have a macro to format a cell as a currency using a bit of code to obtain the currency symbol.

Here is the code involved:

Dim sym As String
sym = reportConstants(ISOcode)
    'Just use the ISO code if there isn't a symbol available
    If sym = "" Then
    sym = ISOcode
    End If
With range(.Offset(0, 3), .Offset(3, 3))
.NumberFormat = sym & "#,##0;(" & sym & "#,##0)"
Debug.Print sym & "#,##0;(" & sym & "#,##0)"
End With

reportConstants is a dictionary object with currency symbols defined as strings. E.g. reportConstants("USD") = "$". This is defined earlier in the macro.

When the macro runs it gets the ISO code and should then format the cell with the corresponding currency symbol.

When I run it in one instance the ISO code is “USD” – so sym is defined as "$" – but it still formats the cell with a pound sign (£). When I debug.print the format cell string it shows $#,##0;($#,##0) so, as long as I got my syntax correct, it should use a dollar sign in the cell. But it uses a £ sign instead. (I am running a UK version of excel so it may be defaulting to £-sign, but why?)

Any help greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:53:22+00:00Added an answer on June 17, 2026 at 6:53 pm

    I just recorded a macro to set the format to $xx.xx and it created this: [$$-409]#,##0.00. Looks like the -409 localises the currency to a particular country; it works without it – try changing yours to .NumberFormat = "[$" & sym & "]#,##0.00"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is really bugging me. I'm using a GridView and want to format it
Ok I have this problem that I've never had before, it's really bugging me.
This is really bugging me. I'm working on overloading the comparison operators in C++,
Eclipse is really bugging me with this. I have an Android project that is
This is really bugging me and I can't figure it out. I have a
I have this really random problem with is bugging me. It works at the
This is really bugging me, but I have a component where a Button is
Hay all, this is really bugging me. I have downloaded phpimage from http://sourceforge.net/tracker/index.php?func=detail&aid=2844769&group_id=103281&atid=738747 I've
This really seems like a bug to me, but perhaps some databinding gurus can
hey guys having this really simple problem but cant seem to figure out have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.