lemiller521
New Member
- Joined
- Aug 28, 2006
- Messages
- 4
I have written some simple code (with help from this group) that highlights the selected row. The code is:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Row = 1 Or Target.Rows.Count > 1 Then Exit Sub
Cells.Interior.ColorIndex = xlColorIndexNone
ActiveCell.EntireRow.Interior.ColorIndex = 36
Range("aa1") = ActiveCell.Row
End Sub
However, when I lock certain columns and protect the worksheet, the ColorIndex property is not accessible. This results in an error message.
Is there some way around this? Perhaps some combination of user permissions when I protect the worksheet?
Thanks.
Lou
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Row = 1 Or Target.Rows.Count > 1 Then Exit Sub
Cells.Interior.ColorIndex = xlColorIndexNone
ActiveCell.EntireRow.Interior.ColorIndex = 36
Range("aa1") = ActiveCell.Row
End Sub
However, when I lock certain columns and protect the worksheet, the ColorIndex property is not accessible. This results in an error message.
Is there some way around this? Perhaps some combination of user permissions when I protect the worksheet?
Thanks.
Lou