PDA

View Full Version : selected cells in yellow



aoc
06-09-2011, 05:57 AM
Dear All,

what can I do if I want below code to run automatically for all workbooks I open. I attached the file.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 6
End Sub
Private Sub Worksheet_Deactivate()
Cells.Interior.ColorIndex = xlNone
End Sub

mikerickson
06-09-2011, 06:36 AM
You could move them to the Workbook_SheetChange and the Workbook_SheetDeactivate events in the ThisWorkbook code module.

aoc
06-09-2011, 06:42 AM
Hi,

I tried but the cell does not change. I attached the file