I have an Excel spreadsheet listing various courses. I have checkboxes in column F for each course (not for every row – there are some gaps). When a checkbox is ticked I want to alter the color of cells B to E on the same row.
Would there be a way of doing this in one method rather than copying the code for each checkbox?
Any help appreciated as always – thanks!
The checkbox idea will be hard to implement. But if you want to have a clickable way to set the background of the cells in that row you can insert a hyperlink on your course title. Have the hyperlink point to the adjacent cells in that row. So if the title is on B3, have the hyperlink point to C3:E3, for example.
Implement the Worksheet_FollowHyperlink event on your sheet’s code-behind. Here is a sample sub to get you started:
This works on Excel 2007. Untested on other versions.