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 Mar 20th, 2002, 12:06 PM   #1
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

I am completely virginal when it comes to the macro. I think this will be a pretty easy question for someone to answer, and I apologize if it's redundant to the board in any way, but I didn't have time to go through all 130 pages of what's already been asked.

Anyway, I have a spreadsheet where I have to enter unique account numbers for clinics. Some clinics are one affiliation, some are another affiliation, and some are no affiliation. I put the text in bold red for the first affiliation and bold blue for the second. Nothing special for no affiliation.

What I thought I'd do is type a .1 at the end of the number when the clinic has type one affiliation & a .2 for type two affiliation, then put in a macro to pick these up and change the text color.

Is this pretty easy to do? Can anyone give me the code for it?

Thanks for your assistance, and might I add that you look really hot today.
invisigirl is offline   Reply With Quote
Old Mar 20th, 2002, 12:07 PM   #2
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

I should probably add that these numbers are all entered in the same column.
invisigirl is offline   Reply With Quote
Old Mar 20th, 2002, 12:12 PM   #3
Von Pookie
MrExcel MVP, Administrator
 
Von Pookie's Avatar
 
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
Default

Good news! You don't need a macro!

If you're going to put the .1 or .2 at the end of them, all you need to do is go to Format/Conditional Formatting and you can set it to change text/background colors if it meets your specifications.
Von Pookie is offline   Reply With Quote
Old Mar 20th, 2002, 12:30 PM   #4
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Well...I had tried that before. I can't see where I am able to specify that the number *includes* any certain digits. Am I just having a blonde moment?

If all that was in that cell was .1 or .2, then I would know how to do it with conditional formatting, but this is a 5-digit number *ending* with .1 or .2. I probably wasn't clear on that before. Sorry!
invisigirl is offline   Reply With Quote
Old Mar 20th, 2002, 12:33 PM   #5
Von Pookie
MrExcel MVP, Administrator
 
Von Pookie's Avatar
 
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
Default

Ah...I inadvertantly missed the "one column" thing.

If you had the 1 or 2 in the cell next to it, for example, it would work.

Sorry!
Von Pookie is offline   Reply With Quote
Old Mar 20th, 2002, 12:57 PM   #6
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

I considered that as well. I could split out the number after the decimal to a new column and be able to make the ones and twos in THAT column red or blue, but I still didn't know how I'd make the 5-digit account number follow the same formatting.

I'm sure this is a simple thing to do with a macro or some other type of visual basic script, but I know zilch about either.

Thanks for trying to help, though!
invisigirl is offline   Reply With Quote
Old Mar 20th, 2002, 01:33 PM   #7
Al Chara
MrExcel MVP
 
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
Default

Try the following procedure:

Add conditional formats to the first cell in the column (I assumed the first cell was A1). Then to test if the cell is account 1, select Cell Value is equal to and put in the following formula:
=A1-MID(A1,6,2)+0.1
Add the format bold and red text. Then to test if the cell is account 2, select Cell Value is equal to and put in the following formula:
=A1-MID(A1,6,2)+0.2
Add the format bold and blue text.
Then copy and paste the "format" down to the rest of your cells.

This procedure assumes that the account number is 5 digits and then a .1, .2, or nothing.
__________________
Kind regards,

Al Chara
Al Chara is offline   Reply With Quote
Old Mar 20th, 2002, 02:07 PM   #8
Von Pookie
MrExcel MVP, Administrator
 
Von Pookie's Avatar
 
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
Default

Or, if you want to put the 1/2 in the other column, you could select the column with the 1/2 and set the conditional formatting to whatever colors you want.

Then, select the other columns, and go to conditional formatting and select "Formula is" then enter =$b1=.1 (assuming the clinic number is in A1).

Then, just click add and change the formula to =$b1=.2 and set your colors.

Hope we've helped you!
Von Pookie is offline   Reply With Quote
Old Mar 20th, 2002, 02:10 PM   #9
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Yay! That worked. Thank you very much.

[ This Message was edited by: invisigirl on 2002-03-20 13:15 ]
invisigirl is offline   Reply With Quote
Old Mar 20th, 2002, 02:15 PM   #10
Al Chara
MrExcel MVP
 
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
Default

What didn't work with my code?
Al Chara 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 07:40 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