投稿日 | : 2003/10/23(Thu) 22:11 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re: エクセルで選択したセルの範囲を取得する方法 |
使用目的によっては違う方法もあると思うのですが。
Dim RowStart As Long
Dim RowEnd As Long
Dim ColStart As Long
Dim ColEnd As Long
RowStart = xlApp.Selection.Row
RowEnd = xlApp.Selection.Rows.Count - 1
ColStart = xlApp.Selection.Column
ColEnd = xlApp.Selection.Columns.Count - 1
RowEnd = RowStart + RowEnd
ColEnd = ColStart + ColEnd
MsgBox "選択範囲は" & RowStart & "行目の" & ColStart & "列目から" & _
RowEnd & "行目の" & ColEnd & "列目までです"