・ Range("A1:C5").Offset(3, 4)
・ ActiveCell
・ ActiveCell.Offset(1, 0).Activate
・ セル.Activate
GetOffsetRange 関数 ( 2009/8/17 Ver 1.1 )
http://blog.livedoor.jp/addinbox/archives/51248924.html
コード: 全て選択
Sub Main1
Dim oSelection As Object
Dim oRange As Object
oSelection = ThisComponent.CurrentSelection
oRange = GetOffsetRange(oSelection, -1, 1, True)
'oRange = GetOffsetRange(oSelection, -1, 1, False)
If Not (oRange Is Nothing) Then
MsgBox Join(Split(oSelection.AbsoluteName, "$"),"") & chr(13) & _
Join(Split(oRange.AbsoluteName, "$"),"")
Else
MsgBox "Nothing"
End If
End Sub
ActiveCellOffset 関数 ( 2009/8/2 Ver 1.0 )
http://blog.livedoor.jp/addinbox/archives/51248934.html
コード: 全て選択
Sub Main1
Dim i As Integer
Dim oCell As Object
oCell = GetActiveCell()
If (oCell Is Nothing) Then
MsgBox "other object is selected"
Exit Sub
End If
For i = 1 to 10
oCell.String = Join(Split(oCell.AbsoluteName, "$"),"")
'[ ActiveCell.Offset(1, 0).Activate ]
oCell = ActiveCellOffset(0, 1) '(Column, Row)
Wait 500
Next i
End Sub
http://blog.livedoor.jp/addinbox/archives/51248934.html
コード: 全て選択
Sub Main1
Dim oCell As Object
oCell = ThisComponent.Sheets(1).getCellRangeByName("B8")
Call CellActivate(oCell)
End sub
AddinBox/VBAユーザーの為のOpenOffice.org 備忘録 『ユーザー定義関数の一覧』
http://blog.livedoor.jp/addinbox/archives/51249421.html