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: 246
Default Slow code needs speeding up!....any ideas??....

I've been running the below code that loops through about 50,000 rows
of one sheet. It checks one of the columns to see if a certain
criteria is matched (ie.that the value in the cell can be found in an
array that is being held in the variable mySetUpArray) and if so it
then transfers various data to other places in the workbook (using
named ranges). The code takes ages to execute - can anyone spot any
parts of the code that could be made more efficient and thus speed
things up??

Any help greatly appreciated,
Jason.


'++++++++++++++++++++++++++++++++++++++
Worksheets("Data").Select
With Sheets("Data")
For Each cell In myRange

'next line will check to see if the value of the
cell matches any of the
'elements in the array mySetUpArray
If Not IsError(Application.Match(cell, mySetUpArray,
0)) Then

'find the name used in the relevent graph
named range
myGraph = WorksheetFunction.VLookup(cell,
Range("Tournaments"), 6, False)

'check to see if it is a defunct
tournament or not
If myGraph < "n/a" Then
With Range("ID_" & myGraph)
.End(xlDown)(2, 1) = cell(1,
0) 'date
.End(xlDown)(1, 2) = cell(1,
7) 'num of A
.End(xlDown)(1, 3) = cell(1,
16) 'prize
.End(xlDown)(1, 4) = cell(1,
23) 'special amount
.End(xlDown)(1, 5) = cell(1,
8) 'time
.End(xlDown)(1, 6) = cell(1,
-2) 'date
.End(xlDown)(1, 7) = cell(1,
1) 'SetUp ID
End With
End If

End If
Next cell
End With
'++++++++++++++++++++++++++++++++++++++

 
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
Help speeding up my code Nick Excel Programming 7 December 15th 06 02:49 PM
speeding up copy and paste code cereldine[_18_] Excel Programming 1 April 20th 06 05:36 PM
Wow. This is interesting and slow. Any ideas? KD[_5_] Excel Programming 0 March 23rd 06 09:08 PM
Help on cleaning / speeding up code Chris Salcedo Excel Programming 2 October 17th 05 01:16 AM
Speeding Up Code [email protected] Excel Programming 8 August 31st 05 04:46 PM


All times are GMT +1. The time now is 02:27 PM.

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

About Us

"It's about Microsoft Excel"