0
votes

I'm using the following formula in conditional formatting to highlight the active row when I click on a cell,

=OR(CELL("row")=CELL("row",A1))

and in VBA editor I am applying this macro to my worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   Target.Calculate
End Sub

Currently I have to repeat the steps when I move onto the next worksheet (with existing data) and for some reason it doesn't always work. Is there a way to apply this to the entire workbook of current worksheets and possible new ones? Many thanks in advance!

condition formatting - new rule

VBA editor

1

1 Answers

0
votes

Have you try placing the VBA into ThisWorkBook?

I do realise placing the VBA into ThisWorkBook generally works better and more accurate than worksheet. In the ThisWorkBook, you could call a specific worksheet to perform the VBA.

With sheets("NameOfWorksheet") Target.Calculate End with