using "ROWLINER" add-in.

D

Dino

I can't get "ROWLINER" add-in to work on a protected sheet. It works when I
unprotect sheet, but not on protected sheet. It is imperative to have
protected sheet, but I really need "ROWLINER" also. Thanks
 
G

Gord Dibben

Not gonna happen.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
ActiveSheet.Unprotect Password:="justme"
If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
OldCell.Borders.LineStyle = xlLineStyleNone
End If
Set OldCell = Target
OldCell.Interior.ColorIndex = 6
OldCell.Borders.LineStyle = xlContinuous
Else
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = Union(OldCell, Target)
End If
End If
ActiveSheet.Protect Password:="justme"
End Sub

Will color the activecell yellow.

Note: will wipe out existing background color of existing cell unless BG color
is due to CF


Gord Dibben MS Excel MVP
 
Top