I'd like a subroutine to execute upon opening the workbook and for a specific sheet in the workbook.
Change the color of the text of the button in a cell based upon the value of another cell in the same column. There will be multiple buttons to do this so each having a corresponding value in a cell to interrogate and then change the button's text color.
To start, on line 12, column B and traversing to Column M, if the value is greater than 0, I want the text of the button in the same column to change to red. So on line 14, those buttons from column B and traversing to Column M.
Here is the sheet.

First LastPosted May 1, 2023, 3:16 PM
I get this error. Failing on the highlighted line below.
Here's your code placed in the open event of the workbook.
Concern: Your comment: ' Loop through rows 12 to the last row with data in column A'.
1.) Why is column A mentioned?
2.) I only want to loop threw the columns of row 12 - being B12 threw M12. No other rows. Then set the buttons on row 14 - being B14 threw M14 accordingly.
Note: my buttons are form control buttons - not Active X.
Jay PankhaniyaPosted May 1, 2023, 1:25 PM