LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Leo Heuser format cleanup code, and a question

( DeleteUnusedCustomNumberFormats() , May 6
2001)
Leo's fine code seems to still hold up but has a killer problem
simulated below:
In XL2002, start a fresh sheet. "General" should be the default cel
format.
Type the mere digit 0 in cell A1. It ought to look like a 0, and b
General format.
A2 =COUNTIF(A1:A1,"0.0%")
A2 gets a 1 … ouch.

Those of you USENET vets who are in harmony with the code and Leo ca
see how this gives a false negative, ruining the results. Th
Application.COUNTIF here "tells" the code that "0.0%" is already show
in the "formats being used" column list, though it isn't; it neve
makes it in the "used" column and ultimately shows as unused. It i
not warm and fuzzy when you delete the format relying on that info!

Now for those of you that don't have the code or don't recall it o
don't follow along with the above paragraph:
1. Is this behavior new with XL2002? (that the countif returns 1 an
not 0)
2. Is COUNTIF really looking for text, or is it cleverl
type-converting? Can I "cast" somehow to subvert that?
3. Is the way out of this mess to use .Find method? O
Application.[something else]?

TI

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leo Heuser Jan Karel Pieterse Excel Discussion (Misc queries) 4 October 11th 07 02:24 PM
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Worksheet Functions 1 September 16th 07 06:54 AM
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Discussion (Misc queries) 2 September 14th 07 08:58 PM
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Worksheet Functions 2 September 14th 07 08:58 PM
Source Data Code Cleanup Help John Michl[_2_] Excel Programming 2 August 18th 03 09:01 PM


All times are GMT +1. The time now is 05:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"