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 3rd, 2002, 05:14 PM   #1
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Let me preface this question with this statement: "I do not know visual basic at all." Just so you know that if you give me some code to use, it's gotta be exact so I can just copy/paste it in.

Okay, here's the deal. I have a huge download listing billing codes for lab tests. Y'all know that when you download out of gigantoid databases, you sometimes get a lot of crap that repeats at the top of every "page break." Well, I need to remove all that crap, and I'd generally just sort by the billing code column, get all the extraneous junk in one chunk of the spreadsheet and then delete it.

The problem is that there are test panels in this list that show a billing code for the panel name but not the test included within it. Therefore, I can't sort by the billing code, which is what it needs to be sorted by even AFTER I remove all the unnecessary info. See below:

SOMEONE'S MEDICAL LABORATORIES
UNIT CODE MASTER LIST
ACCOUNTS RECEIVABLE FEE SCHEDULE(S)
UNIT CODE BILLING NAME CODE PRICE
--------------- -------------------------- ------------ ----------

12345 ACETAZOLAMIDE 80000 12.00

12346 ACETONYLACETONE 80001 40.00

12347 ACHR BLOCKING ANTIBODY 80002 29.50

12348 ACHR BINDING ANTIBODY 80003 15.65

12349 MYASTHENIA GRAVIS AB PNL80004 95.72

12350 CULTURE,ACANTHAMOEBA
CULTURE,ACANTHAMOEBA 80005 41.12
ACANTHAMOEBA SMEAR 80006 19.36
60.48


Well, you see what a mess it is, but I'm used to dealing with it. Anyway, what I need to do is somehow remove all the lines where BOTH a test name AND a price are missing (I know how to remove the line if ONE particular column is not null, but don't know how to add another variable).

After that, I need to be able to fill the billing code down through all the blank cells beneath it (because with the blank lines removed, I won't have to worry about assigning a code to a line w/ no info in it).

FINALLY, I will then be able to safely sort by billing code & remove everything that's not necessary.

I really hope that list came in okay - if not, I'll post a reply & try again.

Can this be done or am I just dreaming?

(Sorry for the length of this question)
invisigirl is offline   Reply With Quote
Old Apr 3rd, 2002, 05:17 PM   #2
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Well, the data example came in pretty bad, but I don't know how else to do it. What I wanted to get across is that the last entry (12350) is a panel, with the billing code assigned to the name to its right, and two tests listed below it that do not have a code assigned to them. That's where I'll need to fill down.

Thanks for any help you can give.
invisigirl is offline   Reply With Quote
Old Apr 3rd, 2002, 05:32 PM   #3
daleyman
Board Regular
 
Join Date: Mar 2002
Location: London, UK
Posts: 167
Default


Okay, shouldn't be a problem, and better use functions instead of code if that is what you will understand and be able to customise...

save it all first unless you get in a mess...

If the only blank column A cells are ones that need filling and the junk lines contain a value here then probably best to deal with filling the blanks first. lets suppose you have your four columns already:

col A: unit code
col B: billing name
col C: Code
col D: Price

...lets fill a new unit code column into column E.

in cell E1 put the equation =A1
in cell E2 put the equation =IF(A2="",E1,A2)

...and fill this equation down to the bottom of the list. Then copy this to values to remove the equations (select the whole column by clicking on the grey column header E, then using the RIGHT MOUSE BUTTON on the EDGE of the selection, move the column away and drop it onto column A to replace the broken list by dragging with then releasing the right mouse button, a menu will appear... select "Copy Here as Values Only"). You can then delete column E.

...then if i understand you correctly you can do the sort and delete as you would have done beforehand. make sure you select all columns with data before you do the sort.
daleyman is offline   Reply With Quote
Old Apr 3rd, 2002, 05:33 PM   #4
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Too easy... With your supplied data pasted into columns A:D...

1. Select columns A:D and choose the Data | Filter | AutoFilter menu command
2. Choose "(Blanks)" from column B's filter arrow drop down list
3. Select and delete all rows that have a blue row number
4. Save your worksheet
5. Select column A and choose the Edit | Go To... Special... Blanks menu command
6. Enter a formula with a reference to the cell above the active cell (e.g., =A10) and press the Control+Enter key combination.
7. Select column A once again and perform a Copy/Paste Special Values.

...continue, by filtering (displaying) repeating headers and then deleting them. You'll also want to filter "(Blanks)" in column D to remove records that don't have a PRICE.

[ This Message was edited by: Mark W. on 2002-04-03 16:33 ]
Mark W. is offline   Reply With Quote
Old Apr 3rd, 2002, 05:46 PM   #5
Paul-Johnson
New Member
 
Join Date: Feb 2002
Posts: 47
Default

I agree with the last post Filters and advanced filters woulb be the easiset and the most flexible.
Paul-Johnson is offline   Reply With Quote
Old Apr 3rd, 2002, 05:48 PM   #6
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Well, the thing with autofiltering is that on the panel name (top line of a panel), there is not a price. But THEN there IS a total price (sum) in the price column in the row underneath the last test in the panel. THAT row doesn't contain a name. The only thing in it is the price.

Now, I suppose what I could do is forget about the totals and do subtotals later, but I wanted to know if it was possible (for future reference) to put in a condition that removes the row if both B and D are null.

For now, I'll use your other suggestions, which were great. If it's possible to do the other thing, let me know.

Thanks for your quick help!
invisigirl is offline   Reply With Quote
Old Apr 3rd, 2002, 05:53 PM   #7
Henry
Board Regular
 
Join Date: Mar 2002
Location: Mike T.
Posts: 180
Default

Send me a portion of the mess. I think I've ran into similar problems
before.

henry@compuvision.net
Henry is offline   Reply With Quote
Old Apr 3rd, 2002, 06:05 PM   #8
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Thanks, I will!
invisigirl 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 06:49 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