SOLVED

MACRO OR CONDITIONAL FORMATTING?

%3CLINGO-SUB%20id%3D%22lingo-sub-2542270%22%20slang%3D%22en-US%22%3EMACRO%20OR%20CONDITIONAL%20FORMATTING%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542270%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%20everyone%2C%20I%20have%20no%20experience%20really%20of%20macros%20(or%20how%20to%20create%20them)%20or%20conditional%20formatting%20so%20I'd%20be%20grateful%20for%20some%20pointers%20-%20not%20even%20sure%20what%20I%20need%20really!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20spreadsheet%20which%20has%20the%20customer%204-digit%20code%20in%20column%20A%20and%20depending%20on%20their%20payment%20terms%20I%20need%20them%20to%20be%20coloured%20one%20of%203%20colours%20(orange%2C%20blue%20and%20pink%20depending%20on%20whether%20they%20pay%20at%2030%20days%2C%2060%20days%20or%2090%20days).%20This%20is%20a%20monthly%20task%20and%20can%20be%20time%20consuming%20to%20pick%20every%20one%20out%20and%20colour%20them%20individually.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20would%20I%20do%20this%2C%20I'm%20a%20complete%20dummy!%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2542270%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542477%22%20slang%3D%22en-US%22%3ERe%3A%20MACRO%20OR%20CONDITIONAL%20FORMATTING%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542477%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1102197%22%20target%3D%22_blank%22%3E%40CarolineH12%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHow%20and%20where%20is%20the%20payment%20term%20specified%3F%3C%2FP%3E%0A%3CP%3EPerhaps%20you%20could%20attach%20a%20small%20anonymized%20sample%20workbook.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542578%22%20slang%3D%22en-US%22%3ERe%3A%20MACRO%20OR%20CONDITIONAL%20FORMATTING%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542578%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eit's%20a%20very%20simple%20sheet%20-%20see%20attached%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542695%22%20slang%3D%22en-US%22%3ERe%3A%20MACRO%20OR%20CONDITIONAL%20FORMATTING%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542695%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1102197%22%20target%3D%22_blank%22%3E%40CarolineH12%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you.%20See%20the%20attached%20version%20-%20now%20a%20.xlsm%20workbook%2C%20so%20you%20will%20have%20to%20allow%20macros%20when%20you%20open%20it.%20Click%20the%20button%20to%20colour%20the%20cells%20in%20column%20A.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542821%22%20slang%3D%22en-US%22%3ERe%3A%20MACRO%20OR%20CONDITIONAL%20FORMATTING%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542821%22%20slang%3D%22en-US%22%3Ewow%20that's%20great%2C%20how%20have%20you%20done%20that!%3F%20It%20would%20help%20me%20to%20know%20because%20I've%20only%20given%20you%20part%20of%20the%20list.%3C%2FLINGO-BODY%3E
New Contributor

hi everyone, I have no experience really of macros (or how to create them) or conditional formatting so I'd be grateful for some pointers - not even sure what I need really!

 

I have a spreadsheet which has the customer 4-digit code in column A and depending on their payment terms I need them to be coloured one of 3 colours (orange, blue and pink depending on whether they pay at 30 days, 60 days or 90 days). This is a monthly task and can be time consuming to pick every one out and colour them individually.

 

How would I do this, I'm a complete dummy!

Thanks!

 

 

7 Replies

@CarolineH12 

How and where is the payment term specified?

Perhaps you could attach a small anonymized sample workbook.

@Hans Vogelaar 

 

it's a very simple sheet - see attached

@CarolineH12 

Thank you. See the attached version - now a .xlsm workbook, so you will have to allow macros when you open it. Click the button to colour the cells in column A.

wow that's great, how have you done that!? It would help me to know because I've only given you part of the list.
best response confirmed by allyreckerman (Microsoft)
Solution

@CarolineH12 

Press Alt+F11 to activate the Visual Basic Editor.

You can see the code of the macro in Module1.

Clicking the button calls this macro.

It will still work if column A and/or column B have more data.

Thank you so much for your help.

@CarolineH12 Okay, you seem to insist on a VBA solution, but you really don't need it. I wonder why you would colour code every customer first, rather than just give them a (number) code and then use Conditional Formatting to look up the code and to colour them. But that's your choice, of course. Excel is great with numbers but requires more complicated solutions if you want to work with colours. Attached an example that uses conditional formatting. Much easier, I believe, and no need for coding at all, and you can expand the ranges to suit your needs.