LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Improving the speed of FOR/NEXT statements

Hi,

I wonder if you can help guys and gals.....

I have 2 spreadsheets. One has about 1000 rows, one has about 28,00
rows.

What I am doing is using a FOR statement to get the next row in th
smaller spreadsheet and then looping through the 28,000 records in th
other spreadsheet to find the matching row using another FOR statemen
that I have nested.
When it is found, it does some changes then exits the inner FO
statement.

Problem is, it takes FOR EVER! (pardon the pun!)

Any ideas as to how I can improve the speed? Here is a scaled dow
version of what I am doing!!!

For RowDates = Range("A1").End(xlDown).Row To 2 Step -1

strRef = Cells(RowDates, "A").Value
StrYes = Cells(RowDates, "B").value

For RDates = Range("A1").End(xlDown).Row To 2 Step -1
if Cells(Rdates, "A").Value = strRef then
' do something

exit for
else

end if
Next

Next



Help!!!

--
Message posted from http://www.ExcelForum.com

 
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
Improving Recalculation Speed for Complex Links Andrew Excel Discussion (Misc queries) 0 November 7th 06 09:29 AM
Improving formula Brad Excel Worksheet Functions 1 April 6th 06 06:02 PM
Improving code.....For Next Mat Excel Programming 3 October 30th 03 06:01 AM
Improving speed with VBA Steven Cheng[_2_] Excel Programming 7 October 12th 03 05:37 PM
need help in improving this macro mcm Excel Programming 0 August 28th 03 04:32 AM


All times are GMT +1. The time now is 01:51 AM.

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"