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 May 4th, 2002, 12:16 AM   #1
JimH
Board Regular
 
Join Date: Apr 2002
Posts: 64
Default

After using the Text Import Wizard to import a text file with multiple columns and thousands of lines, I end up with hundreds of empty rows throughout the worksheet (an empty row being one with no data in the cells of each column). As you can imagine deleting each blank row is a tedious exercise.

Is there a way to automate this process after importing the file?
JimH is offline   Reply With Quote
Old May 4th, 2002, 12:39 AM   #2
Bertie Bagshot
 
Join Date: Feb 2002
Posts: 36
Default

It doesn't need automation. It's quite simple (and quick) to do it manually :-

1. Insert a column before column A
2. Enter the following formula in A1 and fill down =IF(COUNTA(B1:IV1)<>0,"",1)
3.Go to Edit>GoTo>Special>Formulas>Numbers and click OK
4. Go to Edit>Delete>EntireRow and click OK
5. Delete column A
Bertie Bagshot is offline   Reply With Quote
Old May 4th, 2002, 07:33 AM   #3
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default


check this out

http://www.cpearson.com/excel/deleti...eleteBlankRows

I think is what you need !!!
sen_edp is offline   Reply With Quote
Old May 4th, 2002, 10:32 AM   #4
Tikas A. Planck
 
Join Date: Feb 2002
Posts: 47
Default

Quote:
On 2002-05-04 06:33, sen_edp wrote:

check this out

http://www.cpearson.com/excel/deleti...eleteBlankRows

I think is what you need !!!

I think that JimH will be better advised to follow Bertie Bagshot's suggestion - he might then learn more about using Excel's built-in tools.
Tikas A. Planck is offline   Reply With Quote
Old May 4th, 2002, 10:46 AM   #5
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

Don't think that's what JimH wanted for some reason:

Quote:
automate this process
I'm sure Bertie's works, but it's not instant gratification. Nothing wrong with learning VBA from Chip (this guy is good).

Nice call Sen! Have a good weekend all.

_________________
Cheers, NateO

[ This Message was edited by: NateO on 2002-05-04 09:49 ]
NateO is offline   Reply With Quote
Old May 4th, 2002, 11:09 AM   #6
Tikas A. Planck
 
Join Date: Feb 2002
Posts: 47
Default

Quote:
On 2002-05-04 09:46, NateO wrote:
Don't think that's what JimH wanted for some reason:

Quote:
automate this process
I'm sure Bertie's works, but it's not instant gratification. Nothing wrong with learning VBA from Chip (this guy is good).

Nice call Sen! Have a good weekend all.

_________________
Cheers, NateO

[ This Message was edited by: NateO on 2002-05-04 09:49 ]

I would suggest that JimH requested an automated way because he is not familiar enough with Excel's capabilities to do it manually by a simple and quick method.

This is well illustrated by his stating "As you can imagine deleting each blank row is a tedious exercise". Of course it is, but this is not the way to do it - the way to do it is by Bertie Bagshot's suggestion.

Also, if JimH really needs it to be automated, he can record his own macro by following Bertie B's method - this is what I was trying to put across about the benefits of becoming familiar with Excel's built-in tools rather than just relying on someone else to provide a macro.

I might also add that Chip Pearson's macro may not be as efficient as a macro based on Bertie B's method, given the large amount of data that JimH says he has to be processed.
Tikas A. Planck is offline   Reply With Quote
Old May 4th, 2002, 03:02 PM   #7
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Nimrod is offline   Reply With Quote
Old May 4th, 2002, 03:10 PM   #8
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

COUPLE MOUSE CLICKS WILL DO IT
I inport text on a regular basis and remove any blank rows with couple of mouse clicks by using the built in sort function. ... a couple of mouse clicks sorts all the blank rows to bottom of worksheet.
1)select columns you want to sort
2)select "data" on tool bar
3)select "sort" command on drop down menu
4)select "ok" ... DONE
Nimrod is offline   Reply With Quote
Old May 4th, 2002, 05:18 PM   #9
Tikas A. Planck
 
Join Date: Feb 2002
Posts: 47
Default

Nice one, Nimrod !

And of course, if the original sequence is required, just insert a column and fill it with sequential numbers before sorting. After sorting, delete the cells from this inserted column for the blank rows; re-sort by the inserted column; delete the column.
Tikas A. Planck is offline   Reply With Quote
Old May 4th, 2002, 05:27 PM   #10
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
On 2002-05-04 16:18, Tikas A. Planck wrote:
Nice one, Nimrod !

And of course, if the original sequence is required, just insert a column and fill it with sequential numbers before sorting. After sorting, delete the cells from this inserted column for the blank rows; re-sort by the inserted column; delete the column.
Thats exactly the way to do it....nice call,
of course if you do this often then I would
personally automate it, obviously depending
on how many times you would do this...ie
I could do n files with one click and continue
with other work...while this was processed.




__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala 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 -4. The time now is 12:29 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 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