投稿日 | : 2003/03/29(Sat) 15:57 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re: VBからEXCELで選択されているセル範囲を取得したい |
下記を試して見て下さい。
Debug.Print xlApp.Selection.Address
Debug.Print xlApp.Selection.Address(False, False)
又は
With xlApp.Selection
MsgBox "選択範囲の左上のセルの行数は " & .Row & "行目,"
MsgBox "選択範囲の左上のセルの列数は " & .Columns(1).Column & "列目"
MsgBox "選択範囲の右下のセルの行数は " & .Rows(.Rows.Count).Row & "行目,"
MsgBox "選択範囲の右下のセルの列数は " & .Columns(.Columns.Count).Column & "列目"
MsgBox "選択範囲の右上のセルの行数は " & .Row & "行目,"
MsgBox "選択範囲の右上のセルの列数は " & .Columns(.Columns.Count).Column & "列目"
MsgBox "選択範囲の左下のセルの行数は " & .Rows(.Rows.Count).Row & "行目,"
MsgBox "選択範囲の左下のセルの列数は " & .Columns(1).Column & "列目"
End With