FindFormat.NumberFormat fails with some strings

Discussion in 'Microsoft Excel Programming' started by NickHK, Jan 11, 2008.

  1. NickHK

    NickHK Guest

    Excel 03:

    Any ideas why some NumberFormat strings fail ?
    e.g. "$"#,##0_);("$"#,##0)

    Application.FindFormat.NumberFormat = strFormatString

    Seems to error when a non-custom string is applied.

    Found an old post from keepITcool to get the list of Built-in numberformats,
    but prefer not to go that way.

    'Newsgroups: microsoft.public.Excel.programming
    'Date: Thu, 01 Jul 2004 16:21:46 -0700
    'Local: Fri 2 Jul 2004 07:21
    'Subject: Re: Leo Heuser format cleanup code, and a question

    NickHK
     
    NickHK, Jan 11, 2008
    #1
    1. Advertisements

  2. NickHK

    Jim Rech Guest

    Might be the quotes aren't right. This works for me:

    strFormatString = """$""#,##0_);(""$""#,##0)"

    --
    Jim
    "NickHK" <> wrote in message
    news:...
    | Excel 03:
    |
    | Any ideas why some NumberFormat strings fail ?
    | e.g. "$"#,##0_);("$"#,##0)
    |
    | Application.FindFormat.NumberFormat = strFormatString
    |
    | Seems to error when a non-custom string is applied.
    |
    | Found an old post from keepITcool to get the list of Built-in
    numberformats,
    | but prefer not to go that way.
    |
    | 'Newsgroups: microsoft.public.Excel.programming
    | 'Date: Thu, 01 Jul 2004 16:21:46 -0700
    | 'Local: Fri 2 Jul 2004 07:21
    | 'Subject: Re: Leo Heuser format cleanup code, and a question
    |
    | NickHK
    |
    |
     
    Jim Rech, Jan 11, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike

    FindFormat

    Mike, Jul 18, 2003, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    262
  2. R. L. Alan Jordan

    NumberFormat strings for Excel Cells

    R. L. Alan Jordan, Jul 25, 2003, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    288
    Myrna Larson
    Jul 26, 2003
  3. Steffen

    Findformat

    Steffen, Nov 12, 2003, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    242
    Tom Ogilvy
    Nov 12, 2003
  4. Jim at Eagle

    losing Application.FindFormat.NumberFormat after finding first cel

    Jim at Eagle, Apr 27, 2008, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    472
    Jim at Eagle
    Apr 27, 2008
  5. Walter Briscoe

    Find sometimes ignores Application.FindFormat

    Walter Briscoe, Jul 4, 2014, in forum: Microsoft Excel Programming
    Replies:
    3
    Views:
    433
    Walter Briscoe
    Jul 7, 2014
Loading...

Share This Page