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

Copy a Cell and Paste to Range

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
rajeshsegu
Power User
Power User


Joined: 20 Dec 2005
Posts: 53

PostPosted: Fri Aug 18, 2006 4:28 am    Post subject: Copy a Cell and Paste to Range Reply with quote

Hello Friends,

I have got the trick to copy a range and paste it to a cell using the xRangeMovement.copyRange() method but I would like to know how to implement "Copy a Cell and past it to the range" where the content of the cell is replicated throughout the Range.

Please help me achieve this!

Thanks in advance!!

Rajesh Segu
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Fri Aug 18, 2006 4:53 am    Post subject: Reply with quote

Copy cell to cell and use fillSeries function in interface ::com::sun::star::sheet:: .XCellSeries.
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
rajeshsegu
Power User
Power User


Joined: 20 Dec 2005
Posts: 53

PostPosted: Fri Aug 18, 2006 6:10 am    Post subject: But............... Reply with quote

Thanks Velleroy, nice solution, and its working!!!

But, if I want to select a small range of cells and pasting them into a larger range , how should that be done? ( just like how copypaste into a range work , eg., select two cells and copy into a range.. where the source just repeats itself...... ).

I just want to implement this feature generalizing it to copy a range/cell source and paste it into range/cell destination.

Hope you got my requirement....... any help would be appreciated.

Rajesh Segu
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Fri Aug 18, 2006 6:49 am    Post subject: Reply with quote

You know the size of the source from it's address (rCnt=EndRow-StartRow+1, cCount=EndColumn-StartRow+1)
Write a loop, copying while nextRange.EndRow < RequiredTargetRows.
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
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 Macros and API 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