MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 14th, 2005, 04:33 PM   #1
a7n9
 
a7n9's Avatar
 
Join Date: Sep 2004
Location: WV, USA
Posts: 696
Default Excel goes bananas while dealing with blanks

Hello all,

Since quite a few days, I'm (and my office) having strange problems dealing with blanks.

1. I had a few numbers copy and pasted (special) from some formula in a column and in between it had blanks. I checked the lengths of the cells and they were zero, so they were blanks. However, when I tried to use Ctrl + Down key, it was jumping very weird, somehow it was just ignoring the blanks. Then I clicked inside a blank cell and then came out of it, tried Ctrl +Down again, it stopped for that cell but ignored other blanks.

2. I had some other numbers and blanks in a column, I used CountA to count the number of non-blank cells, again the same problem. It was counting blank cells too, but when I clicked inside a cell the count was reducing and it wasn't working for all the blank cells. Some blank cells even after clicking inside were still counted.

Sorry for such a long description but I had to explain. So has anybody faced similar kind of problem ever?
__________________
If you've exhausted all the possibilities, remember this; you haven't!
<a href = "http://www.nandeshwar.info">My home page</a> My Excel/VBA Blog
a7n9 is offline   Reply With Quote
Old Apr 14th, 2005, 04:48 PM   #2
Smitty
MrExcel MVP
Moderator
 
Smitty's Avatar
 
Join Date: May 2003
Location: Boulder Creek, CA
Posts: 20,903
Default

Just a thought, but highlight that column, then Data-->Text to Columns-->Filter in place (destination should be the same as the source range).

HTH,

Smitty
__________________
Smitty

Every once in a while, there's a sudden gust of gravity...

Microsoft Excel MVP

Smitty is offline   Reply With Quote
Old Apr 14th, 2005, 04:50 PM   #3
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,653
Default

Quote:
...I checked the lengths of the cells and they were zero, so they were blanks...
You need to rethink the statement above.

******** ******************** ************************************************************************>
Microsoft Excel - Book1___Running: xl2002 XP : OS = Windows XP
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

A
B
C
D
E
1
LENISBLANK
2

0FALSE
3
4
5
Sheet4

[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
__________________
Windows XP Pro/Office 2003 SP2
Mark W. is offline   Reply With Quote
Old Apr 14th, 2005, 04:52 PM   #4
gaynard_nelson
 
Join Date: Dec 2002
Location: Tempe, Arizona
Posts: 323
Default Re: Excel goes bananas while dealing with blanks

Quote:
Originally Posted by a7n9
Hello all,

Since quite a few days, I'm (and my office) having strange problems dealing with blanks.

1. I had a few numbers copy and pasted (special) from some formula in a column and in between it had blanks. I checked the lengths of the cells and they were zero, so they were blanks. However, when I tried to use Ctrl + Down key, it was jumping very weird, somehow it was just ignoring the blanks. Then I clicked inside a blank cell and then came out of it, tried Ctrl +Down again, it stopped for that cell but ignored other blanks.

2. I had some other numbers and blanks in a column, I used CountA to count the number of non-blank cells, again the same problem. It was counting blank cells too, but when I clicked inside a cell the count was reducing and it wasn't working for all the blank cells. Some blank cells even after clicking inside were still counted.

Sorry for such a long description but I had to explain. So has anybody faced similar kind of problem ever?
Is it possible that you have a label in those supposedly blenk cells ('). If you do that could be the problem. That would show 0 length but is still occupied and end down arrow would consider it an occupied cell. The label would only be visible on the edit line and could be removed with the delete key.
__________________
Started building macros in Lotus 123, then Quattro Pro and now program in Excel VBA.

Gaynard Nelson

The race is not always to the swift
But to those who keep on running
gaynard_nelson is offline   Reply With Quote
Old Apr 14th, 2005, 05:12 PM   #5
a7n9
 
a7n9's Avatar
 
Join Date: Sep 2004
Location: WV, USA
Posts: 696
Default

gaynard_nelson: No I checked it very closely, there was nothing in "blank cells"

Mark W.: Thanks, I wasn't aware of that. But why even after you copy and paste special it-you don't see anything there but still ISBLANK is False?

Smitty: Thanks, I'll try that.

Thanks all for your replies. I know what the problem is now, but what is solution how do we overcome it, if we've many rows. May be we can write macro, let me see.
__________________
If you've exhausted all the possibilities, remember this; you haven't!
<a href = "http://www.nandeshwar.info">My home page</a> My Excel/VBA Blog
a7n9 is offline   Reply With Quote
Old Apr 14th, 2005, 05:16 PM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,653
Default

Quote:
Originally Posted by a7n9
gaynard_nelson: No I checked it very closely, there was nothing in "blank cells"

Mark W.: Thanks, I wasn't aware of that. But why even after you copy and paste special it-you don't see anything there but still ISBLANK is False?

Smitty: Thanks, I'll try that.
Because the null string, "", is something that can be copied and pasted. It has a LEN of 0, but ISTEXT returns TRUE, and ISBLANK returns FALSE.

Now to really mess you up... COUNTBLANK returns 1. Consult the Excel Help topic for these functions to understand these distinctions.
__________________
Windows XP Pro/Office 2003 SP2
Mark W. is offline   Reply With Quote
Old Apr 14th, 2005, 06:28 PM   #7
a7n9
 
a7n9's Avatar
 
Join Date: Sep 2004
Location: WV, USA
Posts: 696
Default

Thanks for reply Mark.

I wrote this macro to create true blanks.
Code:
Sub make_true_blanks()
Dim c As Range
For Each c In Selection
    If Len(c) = 0 And WorksheetFunction.IsText(c) Then
        c.ClearContents
    End If
Next
MsgBox "Done!"
End Sub
__________________
If you've exhausted all the possibilities, remember this; you haven't!
<a href = "http://www.nandeshwar.info">My home page</a> My Excel/VBA Blog
a7n9 is offline   Reply With Quote
Old Apr 14th, 2005, 07:36 PM   #8
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,653
Default

Also, you could have selected any single, column verticle array, and used Excel's Data | Text to Columns... menu command to parse the values eliminating any empty (null) text strings, leading/trailing spaces, and for numeric values -- leading zeroes.
__________________
Windows XP Pro/Office 2003 SP2
Mark W. is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 03:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2010 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes