| 
    
     |  | はじめまして。馬詰と申します。 
 1をいれて伊藤とか、2をいれて鈴木、3をいれて間宮というように、
 Sheet1に名前一覧があって、Sheet2に番号を入れると名前になるようになっています。
 具体的には次のような、マクロが入っています。
 Private Sub TextBox1_Change()
 
 End Sub
 
 Private Sub Worksheet_Change(ByVal Target As Range)
 Dim MyRow As Long, MyEnd As Long
 Dim Ws As Worksheet
 Application.EnableEvents = False
 If Target.Count <> 1 Then Exit Sub
 MyRow = Val(Target.Value)
 Set Ws = Worksheets("名前")
 MyEnd = Ws.Cells(65536, Target.Column).End(xlUp).Row
 If MyEnd = 1 Then Exit Sub
 If MyRow > 0 And MyRow <= MyEnd Then
 Target.Value = Ws.Cells(MyRow, Target.Column).Value
 End If
 If Application.WorksheetFunction.CountIf(Target.EntireColumn, Target.Value) > 2300 Then
 MsgBox ("?")
 Target.Value = ""
 End If
 Application.EnableEvents = True
 End Sub
 
 しかし、別のデータから番号を貼り付けた場合、変わるようにもしたいのです。
 どのような、マクロを付け加えればよいでしょうか?
 
 
 |  |