Sorry for breach of rules of forum.
Sir, problem could not be resolved. The matter is I have a checkbox in my custom iribbon. When I check this checkbox, wherever I click on any cells on any worksheet, the relative row and relative column should be highlighted. VB Code replied by you and Code mentioned in the Public Function Function_Action do the same work, but only one time. I want the highlighting on every click till the Checkbox is unchecked. Can it be possible to call Public Function Worksheet_SelectionChange(ByVal Target As Range) when pressed is true.
iRIBBON as follows:
<checkBox id="cbHighlight" label="Highlight" supertip="This will highlight active Row and Column, wherever you click on the cell." onAction="Function_Action" />
Public Function Function_Action(control As IRibbonControl, pressed As Boolean) If pressed Then ActiveCell.EntireRow.Interior.ColorIndex = 20 ActiveCell.EntireColumn.Interior.ColorIndex = 20 Else Cells.Interior.ColorIndex = xlColorIndexNone End If End Function