View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cereldine[_18_] cereldine[_18_] is offline
external usenet poster
 
Posts: 1
Default speeding up copy and paste code


Im developing some code that will look for values in about 1
spreadsheets that are provided for us externally (sheet A).
I need to extract about 115 columns of data out of about 123 b
determining the criteria, i can do this fine, i can also declare th
range i want to copy fine and if this code is run on its own it wil
loop through to the end in seconds.

The code starts to slow down when i start adding the code to paste th
data into the required spreadsheet (sheet B), this has to be done on
coloumn at a time so as to ommit columns i don't need. the copy cod
and paste code work really fast, the code slows down when iv
performed one iteration and am reopening/activating sheet A afte
pasteing in sheet b?

I can't understand what the problem is, basically if i choose to
remove the copy and paste code and just have the sheets open in th
loop 123 times it still goes at snails pace ie 5 seconds a loop! It
not the sheets that are a problem as i recorded a macro to test thi
problem and it runs at the normal speed that i desire.

ive been opening workbooks with following
Windows("intermediate.xls").Activate OR
bkI.Activate - where bki is a declared workbook

Any idea

--
cereldin
-----------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...fo&userid=3206
View this thread: http://www.excelforum.com/showthread.php?threadid=53466