| 
    
     |  | ずいぶん昔になりますが、sheet1に表がありまして、その表にsheet3゛教師名″に縦に並べられた、人名を行番号を打つとsheet1にでるというマクロを下のように、つくって いただいたのですが、今現在動かなくなってしまいました。何か原因が考えられますか?
 つぎのようなマクロです。
 
 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) > 1 Then
 MsgBox ("( ゚Д゚)ハァ?")
 Target.Value = ""
 End If
 Application.EnableEvents = True
 End Sub
 
 よろしくお願いします。
 
 
 |  |