Forum Discussion
MACRO OR CONDITIONAL FORMATTING?
- Jul 13, 2021
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.
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.
- CarolineH12Jul 13, 2021Copper ContributorThank you so much for your help.
- Riny_van_EekelenJul 13, 2021Platinum Contributor
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.