On 2002-08-26 05:10, Jack in the UK wrote:
Hi another try / way
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = -4142
With Target.Interior
.ColorIndex = 5
End With
End Sub
Sorry Jack,but I get still an errorOn 2002-08-26 05:10, Jack in the UK wrote:
Hi another try / way
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = -4142
With Target.Interior
.ColorIndex = 5
End With
End Sub
Sorry;but it works not to me.On 2002-08-26 06:43, dantb wrote:
Hi Jack, the code works, but why do you loose the copy paste function?
Private Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:IV65536"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Range("A1:IV65536").Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Sorry;but it works not to me.On 2002-08-26 06:43, dantb wrote:
Hi Jack, the code works, but why do you loose the copy paste function?
Private Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:IV65536"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Range("A1:IV65536").Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Sorry;but it works not to me.On 2002-08-26 06:43, dantb wrote:
Hi Jack, the code works, but why do you loose the copy paste function?
Private Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:IV65536"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Range("A1:IV65536").Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Sorry;but it works not to me.
See above,it is a protected sheet,with only the cells unlocked who I need this macro and in that range there are already colour cells.
I have a macro that works perfect on a new sheet:
Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:Z20"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Cells.Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Thanks for a solution.
Sorry;but it works not to me.
See above,it is a protected sheet,with only the cells unlocked who I need this macro and in that range there are already colour cells.
I have a macro that works perfect on a new sheet:
Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:Z20"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Cells.Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Thanks for a solution.
O.K. but it works only when I remove my sheet protection.On 2002-08-26 12:57, rikrak wrote:
Sorry;but it works not to me.
See above,it is a protected sheet,with only the cells unlocked who I need this macro and in that range there are already colour cells.
I have a macro that works perfect on a new sheet:
Sub Worksheet_SelectionChange(ByVal target As Range)
If Intersect(Range("A1:Z20"), Range(target(1).Address)) _
Is Nothing Then Exit Sub
Cells.Interior.ColorIndex = xlNone
ActiveCell.Interior.Color = vbCyan
End Sub
Thanks for a solution.
What about a pattern, so each cell can keep it's color?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("A1:Z20"), Range(Target(1).Address)) Is Nothing Then Exit Sub
Cells.Interior.Pattern = xlSolid
ActiveCell.Interior.Pattern = xlGray16
End Sub