|
こんばんは。sheet2については、FINDを使用しました。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myR As Range
Dim endR As Range
Dim fndR As Range
On Error Resume Next
If Target.Column <> 1 Then Exit Sub
If Target.Value <> "" Then Target.Resize(1, 3).Interior.ColorIndex = 3
With Sheets("sheet2")
Set endR = .Range("a65536").End(xlUp)
Set fndR = .Range(.Range("a1"), endR).Find(Target.Value, , , xlWhole)
If Not fndR Is Nothing Then Exit Sub
If endR = "" Then
endR.Value = Target.Value
Else
endR.Offset(1).Value = Target.Value
End If
End With
End Sub
|
|