Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Better Way To Do This SLOW code

Please help me.

I am importing two .csv files from an Oracle table into a workbook:
SalesRep, MainRep

Column A: is Bank
Column B: is Rep Name
Column C: is Branch #
Columns N:R contain data.

The process is to compare the MainRep page to the SalesRep page.
So for each row on the MainRep page, If the Bank and Rep Name and
Branch #, are
found on the SalesRep page, do nothing, else, add the entire row to the
SalesRep page.

Currently I have declared the 3 ranges on the SalesRep page and
inserted an Array formula.
in the next empty column of row 1.
Sheets("SalesRep").Cells(1, NxtCol).FormulaArray = "=MATCH(R[0]C[1]&
R[0]C[2]&R[0]C[3],Bank & SalesAENames & SalesBranchNum,0)"

and for each cell in the MainRep page I add the cell values so the
formula will compute
Sheets("SalesRep").Cells(1, NxtCol + 1).Value = Bank
Sheets("SalesRep").Cells(1, NxtCol + 2).Value = AeName
Sheets("SalesRep").Cells(1, NxtCol + 3).Value = AeBranch

next piece is to check if formula gives error(means I have to add the
rep and bank and branch, etc.)
If IsError(Sheets("SalesRep").Cells(1, NxtCol).Value) Then
add the current row from the mainrep page.
else
do nothing.

this was ok when i tested with my data, however, the oracle table
results are 17,000
records, and it takes a long time to process. Any idea on a better way
to compare these values? any help would be greatly appreciated.

Thank you.
Ron.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Better Way To Do This SLOW code

In article . com,
wrote:

I am importing two .csv files from an Oracle table into a workbook:
SalesRep, MainRep

Column A: is Bank
Column B: is Rep Name
Column C: is Branch #
Columns N:R contain data.

The process is to compare the MainRep page to the SalesRep page.
So for each row on the MainRep page, If the Bank and Rep Name and
Branch #, are
found on the SalesRep page, do nothing, else, add the entire row to the
SalesRep page.

this was ok when i tested with my data, however, the oracle table results
are 17,000 records, and it takes a long time to process. Any idea on a
better way to compare these values? any help would be greatly
appreciated.


Can you do the Join in a temporary table in Oracle, then read that table
into your spreadsheet? In general, a database will be faster at doing a
join than a spreadsheet will.

--
Randy Hudson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone help me with this slow code BillReese Excel Programming 7 September 3rd 05 12:34 AM
Slow Code Shawn Excel Programming 7 August 23rd 05 08:44 PM
SLOW Code... Ernst Guckel[_4_] Excel Programming 2 March 20th 05 10:58 AM
Slow Code Frank Kabel Excel Programming 1 July 23rd 04 09:28 AM
Is this slow code? Tom Excel Programming 4 March 3rd 04 11:18 PM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"