A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Press Alt+F11 to activate the Visual Basic Editor.
Select Insert > Module.
Copy the following code into the module:
Function HasComment(r As Range) As Boolean
Application.Volatile
HasComment = Not r.Comment Is Nothing
End Function
Press Alt+F4 to close the Visual Basic Editor.
Select cells A4:A28. I'll assume that A4 is the active cell within the selection.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=HasComment(D4)
Click Format...
Activate the Fill tab.
Select a highlight color.
Click OK twice.
Remark: the conditional formatting will not be updated automatically when you add or remove a comment, but it will be updated each time the workbook is recalculated. If necessary, press F9 to calculate.
Save the workbook as a macro-enabled workbook (.xlsm, .xlsb or .xls, but not .xls).
Make sure that you enable macros when you open the workbook.