extrasupereasy macro question

invisigirl

Board Regular
Joined
Mar 18, 2002
Messages
130
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.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Good news! You don't need a macro! :biggrin:

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.
 
Upvote 0
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!
 
Upvote 0
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!
 
Upvote 0
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!
 
Upvote 0
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.
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top