OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Getting the cell range

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
priyanthan88
Newbie
Newbie


Joined: 14 Nov 2010
Posts: 3
Location: Sri Lanka

PostPosted: Tue Nov 30, 2010 3:58 am    Post subject: Getting the cell range Reply with quote

Hi,

Can anyone help me to get the cell range selected by mouse drag.
Code in java would be better.
Or specify the steps to be followed .

Thanks
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue Nov 30, 2010 10:18 am    Post subject: Reply with quote

Don't do Java any more but here's a Basic example.
Code:
Sub GetSelectedRange
cr = ThisComponent.getCurrentSelection
Print cr.AbsoluteName
'Assumes a single column in the selection.
'Note that the first cell in the selection is always at position 0,0
'no matter where the range actually is.
For x = 0 To cr.Rows.Count-1
 cell = cr.getCellByPosition(0,x)
 Print cell.getString
Next
End Sub
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group