Excel script for filling cells within a specified range with a specific fill color if any cell within the range is selected

Robin Theodore 0 Reputation points
2024-03-31T14:28:49.82+00:00

Using scripts in Excel (NOT VB macros), I need to be able to fill any cell within a specified range with a specific color if any cell within the range is selected ("clicked on"). Note that the spreadsheet will have different columns that need to be different colors. For example, if any cell in range B3:B100 is selected, the cell should fill yellow (without needing to type anything). If any cell in range C3:C100 is selected, the cell should fill green. If any cell in the range D3:D100 is selected, the cell should fill red. I used a VB macro which worked fine on a desktop or laptop, but I need this functionality to work specifically on cell phones (iOS or Android) and tablets so VB macro is not a viable solution. Below is the VB macro I wrote:

https://learn-attachment.microsoft.com/api/attachments/53fdf6bb-482a-46bb-989d-f381352db363?platform=QnA

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
Developer technologies | VB
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.