セルの値が変更された際に発生するイベント

セルの値が変更されたときに発生するイベントです。

Private Sub Worksheet_Change(ByVal Target As Range)
     Debug.Print "変更されたセルの行"; Target.Row
     Debug.Print "変更されたセルの列"; Target.Column
     Debug.Print "変更されたセルの値"; Target.Value
End Sub

これで変更されたセルの位置、値を得ることが出来ます。
ただし、複数のセルの値を同時に変更した場合には、Target.Valueを表示させるときにエラーになります。
VBAのお勉強 まとめに戻る

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 simple blog いろいろ勉強中 Suffusion theme by Sayontan Sinha