I have the following code which changes a cells interior when changed, and inputs a "1" in column W. Doesn't seem to work with copy and paste? The interior colour change works, but the input of "1" will only work with a single entry... any help?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngtemp1 As Range
Dim rngTemp3 As Range
Dim wsTemp As Worksheet
Dim lngLastRow As Long, RR As Long
If ThisWorkbook.ActiveSheet.Name = "TRIAL" Then
Set wsTemp = ThisWorkbook.Worksheets("TRIAL")
lngLastRow = wsTemp.Range("D" & Rows.Count).End(xlUp).Row
Set rngtemp1 = wsTemp.Range("J2:U" & Trim(Str(lngLastRow)))
If Not Intersect(Target, rngtemp1) Is Nothing Then
With Target.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Set rngTemp3 = wsTemp.Range("W" & (Target.Row))
rngTemp3.Value = "1"
End If
End If
End Sub