G
Guest
Does anyone know how to make the cell highlight, only when it it selected,
and keep moving with the curser as you move around the spreadsheet?
and keep moving with the curser as you move around the spreadsheet?
Jim May said:Paste this into the files Thisworkbook Module - Selected cell will be
highlighted
in all your sheets - even better this macro does not affect existing
Conditional formatting..
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
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
End Sub
Jim May said:Paste this into the files Thisworkbook Module - Selected cell will be
highlighted
in all your sheets - even better this macro does not affect existing
Conditional formatting..
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
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
End Sub
Thanks Max;
My initial response goes to perhaps setting up a Flag (boolean) type for
On/Off, True/False... you know
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.