LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 1
Default Is this slow code?

Hi all,

Is my implementation the best way to do this?? My code works but it is very
very
slow - but my user base which will use the code are al on P2's as well!

I am trying to achieve the following:

I have a list of 30 items in a col in a spread sheet.
I have 1 other cell which are constants
I have a [5][1000] table on another sheet in the spready, of which I am
retreiving only values from 2 columns.

For each item in the 30 column list, I want to check all 1000 rows, to
determine if any of the rows match the item, and the 1 constant. If a match
is found then I'm done and I break out.


Am I doing something really ineffcicent?

any help

Thanks

Tom



'Set up the loop. This is a decrementing loop becuase we want to delete
items out of it _
with out effecting the index
'Note the list stops at 2 to ensure the Heading is not removed.
For listCount = listLoop To 2 Step -1
' set the delete condtion to true
DeleteLogic = True
' get the item at the bottom of the list
listValue = Sheet13.Range(listRange & listCount)

' Set up the second loop which will loop through the entire config
table this loop _
increments
For rConfigCount = 2 To rConfigLoop
' Perform the test: If the workstream and list values exsist in
a config row _
then do not delete
If Trim(listValue) < "" _
And _
rConfig.Cells(rConfigCount, configCheck1).Value = listValue _
And _
rConfig.Cells(rConfigCount, configCheck2).Value = userSelection
_
Then
' if a match is found then I don't want to delete
DeleteLogic = False
' if a match is found there is not point searching the rest
of the table.
Exit For
End If

Next rConfigCount
'Perform delete if necessary
If DeleteLogic = True Then _
Sheet13.Range(listRange & listCount).Delete xlShiftUp

Next listCount



 
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Slow VBA code....Hide/Unhide Loop Tami Excel Worksheet Functions 2 August 4th 09 01:53 AM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
QUERY & HELP: so slow executing VBA code... :S John Keith Excel Worksheet Functions 3 February 13th 06 03:47 PM


All times are GMT +1. The time now is 07:31 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"