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://filestore.community.support.microsoft.com/api/images/53fdf6bb-482a-46bb-989d-f381352db363?upload=true&fud_access=wJJIheezUklbAN2ppeDns8cDNpYs3nCYjgitr%2BfFBh2dqlqMuW7np3F6Utp%2FKMltnRRYFtVjOMO5tpbpW9UyRAwvLeec5emAPixgq9ta07Dgnp2aq5eJbnfd%2FU3qhn54DzR3kEhjg25dSh9EJTGwFnkslw4ql2CnGNMvEjCC0I61r42Eq0k2I8MZdawn%2BaD6YVP0QthufnxxhjScv6tjypuYvXYUk1z5BO61jSZU4kRz%2B%2BTh8daLm41bcDsNc9Mqq8xkH%2FOXmfRdLGFntkaTe3rjs91l8SwEev3JdzGuj8Kff8CwtVAJSuVOwrM%2BIw5fj0BOvpOcqO9PRfIbwBy6lpblPhll0BWPC4THdI2%2Bdg7uANaNWPuBEwu8MsBrzu4QZVQGC7%2FkpL9%2BIrgmCGRBwAUHnLuzrnfEyV7M790MaXA%3D

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,947 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,732 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,963 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,725 questions
0 comments No comments
{count} votes

Your answer

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