View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Kobayashi[_16_] Kobayashi[_16_] is offline
external usenet poster
 
Posts: 1
Default Hopefully simple Select Case error

Tom,

Thanks for replying, again.

You're right, I did initially have many If conditions. And, thanks to
your help I got it working. And, when they were all "Criteria..." and
"Critieria..." it was fine. But I then ran into difficulties when I
needed to ascertain additional criteria for just one of the listed
criteria! I got into a mess and just couldn't work it out so I thought
I'd try the Select case approach. At the time I didn't realise, even
after searching this site and the web, that this is not the best option
if you wish to use 'AND'!

I finally got it working by using the Select Case procedure and then
looping through all the cells again with an IF function. This clearly
isn't the best way to do it! I then have to loop through the cells
again for my next procedure due to my inexperience!

Thus, to check 1000 rows of data for one column and delete the rows
that do not meet the criteria to leave an amount of 200 rows, then
assign a simple value such as a name into another column for the
remaining 200 rows has taken me about 6 very long sub procedures to
create, and three loops through the same range! ;-(
It finally works but I know the code will be a nightmare to maintain
and it also takes nearly 2.5 minutes to run!

Regards,

Adrian



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/