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

compare rows

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


Joined: 10 Aug 2004
Posts: 15

PostPosted: Tue Aug 10, 2004 1:43 pm    Post subject: compare rows Reply with quote

Hello,

I have a spreadsheet with 4 sheets. Sheet 1 contains 22652 rows, sheet 2 contains 22975 rows and sheet 3 contains 13790 rows. I need to compare sheet 1 against sheet 2 and then sheet 3 to find any matching rows. If a match is found I then need to place the matching row from sheet 1 into sheet 4. In the end sheet 4 should only contain the rows that are present in sheet 1 and either sheet 2 or 3.

I have tried using loops to compare the rows from sheet 1 to all the rows in sheet 2 and 3, this works but is very slow.

Can anyone point me in a different direction that hopefully runs faster.

thanks
gerald
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Wed Aug 11, 2004 11:50 am    Post subject: Reply with quote

you can compare rows in the same sheet using the queryRowDifferences method:
http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/XCellRangesQuery.html

I am not aware of any method to quickly compare two sheets. You may find the section in my Macro document titled Searching a Calc document to be of interest. I compare the times to obtain the cell data using different methods.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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