Launching macros automatically

Lookout_Joe

New Member
Joined
Feb 21, 2002
Messages
2
I have written a macro to change the color of individual cells in a matrix based on the cell value. In this case, the cell values are vendor names, and I'd like the cell background to automatically change based on the formula results which indicate the best vendor.

I tried the conditional formatting thing, but it only supports 3 conditions, and I have many more potential vendors (cell values) than that.

I'd like the matrix colors to change when the user makes a chage/entry to the spreadsheet. In the past I've put a button on the worksheet for the user to click in order to update the formatting, but I'd like something more elegant if possible.

Any thoughts?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Put it in the Worksheet_Change() event and determine if any of the dependant cells (The ones that determine if a new color is needed) has changed (Using Intersect and Target), or, use the Worksheet_Calculate() event. This option I DO NOT recommend, i think it would make the workbook terribly slow !
 
Upvote 0
I opted for the Worksheet_Calculate() option on the worksheet in question since the vendor names I mentioned are selected by formulas. My research indicated that the Worksheet_Change() event wouldn't fire if the cell contents changed as a result of forumala output. The Worksheet_Calculation() solution works, but as you suspected has slowed the workbook down a little, but not too much.

Many thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,308
Members
448,886
Latest member
GBCTeacher

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