Excel VBA セルをダブルクリックして その行番号を取得

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
203 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 17, 2011

http://q.hatena.ne.jp/1321525022 の 質問に対しての事前調査?
.
シート名のところで、右クリックを押してコード表示を選択。
すると、シートにコード(イベント)が書けるので、
BeforeDoubleClickに処理を書いてみます。
.
Targetで対象のオブジェクトが引数で渡されるので、
単純に、ターゲット.アドレス など Rangeのプロパティで取得してみました。
※.Rowで行番号を取得

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) MsgBox Target.Row, 23
End Sub

応用?
cells(ダブルクリックした行番号,23)に入っているデータを取得
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) MsgBox Cells(Target.Row, 23)
End Sub
↑こんな感じで使ってみてください?

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more