Hi,
Can anyone help me with a code to get the address of the the first and last cell of the selected cells.
Note:
Selected cells can have empty cells.
[Solved] Getting Cell address of the current selection
[Solved] Getting Cell address of the current selection
Last edited by Hagar Delest on Thu May 14, 2015 4:29 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Open Office 4.1.1
Windows 7
Windows 7
Re: Getting Cell address of the current selection
Code: Select all
Sub GetRangeName
oRange = ThisComponent.getCurrentSelection()
print oRange.AbsoluteName
end sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Getting Cell address of the current selection
or:
Code: Select all
Sub Getcellname
oRange = ThisComponent.getCurrentSelection()
print oRange.AbsoluteName
oCellTopLeft = oRange.getCellByPosition(0, 0)
print oCellTopLeft.AbsoluteName
lRows = oRange.getRows().getCount()
Print lRows
lCols = oRange.getColumns().getCount()
print lCols
oCellRightBottom = oRange.getCellByPosition(lCols-1, lRows-1)
print oCellRightBottom.AbsoluteName
end sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
[Solved] Getting Cell address of the current selection
Dear Sir,
It worked. Thank you for spending your time for me.
It worked. Thank you for spending your time for me.
Open Office 4.1.1
Windows 7
Windows 7