ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FindFormat.NumberFormat fails with some strings (https://www.excelbanter.com/excel-programming/404066-findformat-numberformat-fails-some-strings.html)

NickHK

FindFormat.NumberFormat fails with some strings
 
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: Leo Heuser format cleanup code, and a question

NickHK



Jim Rech[_2_]

FindFormat.NumberFormat fails with some strings
 
Might be the quotes aren't right. This works for me:

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

--
Jim
"NickHK" wrote in message
...
| 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: Leo Heuser format cleanup code, and a question
|
| NickHK
|
|




All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com