Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Holloween Mystery: ghostly blank cells

This one will have you whistling past the graveyard.

Cells in C1:C10 have a simple counting formula if an
adjacent cell is non-blank. At some point my code Copies
and Paste Specials the formula range, so that the formulas
are replaced by their numeric values.

Now the goblins appear. Lets say C1:C5 have numbers, but
C6:C10 have nothing because the formula says if the
adjacent cell is blank, give this cell a "". When I sort
C1:C10 in Descending order, the "blank" ("") spaces go to
the <top of the sorted list. OK, I thought that the blank
cells aren't really blank, so I checked their Len(). It
was 0, so they really <are blank. But still they go to
the top, so they must contain a hidden <something. But
what is it? Isn't a cell defined as "" a blank?

How do I make the blank goblins behave, and stay at the
bottom of the sort???

TIA
Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Holloween Mystery: ghostly blank cells

They contain a null string which isn't blank.

Rather than do a paste special do
for each cell in Range("C1:C10")
if len(trim(cell)) = 0 then
cell.ClearContents
else
cell.Formula = cell.Value
end if
Next

--
regards,
Tom Ogilvy

"Paul" wrote in message
...
This one will have you whistling past the graveyard.

Cells in C1:C10 have a simple counting formula if an
adjacent cell is non-blank. At some point my code Copies
and Paste Specials the formula range, so that the formulas
are replaced by their numeric values.

Now the goblins appear. Lets say C1:C5 have numbers, but
C6:C10 have nothing because the formula says if the
adjacent cell is blank, give this cell a "". When I sort
C1:C10 in Descending order, the "blank" ("") spaces go to
the <top of the sorted list. OK, I thought that the blank
cells aren't really blank, so I checked their Len(). It
was 0, so they really <are blank. But still they go to
the top, so they must contain a hidden <something. But
what is it? Isn't a cell defined as "" a blank?

How do I make the blank goblins behave, and stay at the
bottom of the sort???

TIA
Paul



Reply
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
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
Excel 2002: Return blank when VLOOKUP on blank cells Mr. Low Excel Discussion (Misc queries) 2 June 4th 09 05:12 PM
"Calculating Cells" Mystery WildWill Excel Discussion (Misc queries) 2 February 27th 09 09:47 AM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Mystery: System Error and blank squares Bettergains Excel Discussion (Misc queries) 0 September 7th 05 05:56 PM


All times are GMT +1. The time now is 01:26 AM.

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

About Us

"It's about Microsoft Excel"