hi guys can someone help me with this code?
Sub Worksheet_SelectionChange(ByVal Target As Range)
'more than one cell selected
If Target.Count > 1 Then Exit Sub
'use Static because when declared at the procedure level,
'it will not lose it's content when the program is not in their procedure
Static LastChanged As String 'last cell address
Application.ScreenUpdating = False
If LastChanged = Empty Then
LastChanged = ActiveCell.Address
End If
'clears previous highlight
With Range(LastChanged)
.EntireRow.Interior.ColorIndex = xlNone
End With
'highlights active cell row
With Target
.EntireRow.Interior.ColorIndex = 15
End With
LastChanged = Target.Address
Application.ScreenUpdating = True
End Sub
the problem im getting is i cant seem to select the entire sheet, and i want to select parts of the sheet so i can lock certain cells.
Thanks
Bookmarks