Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default couple for each performance questions

i use a for each cell in range("L3:L33") statement. the previous code loads
about 40 workbooks, then cycles through 12 sheets using the for each statement.

it searches for an R or an A, can be either throughout the L3:L33 range. most
cells are blank, though. if it finds an R or A, it has to check offset(0,1) for
another value. i need to keep track of the counts of each of the 3.

i have the code working fine, so i don't really need code, just giving some
background on what i am doing. probably takes less than 2 seconds a workbook.

but i was wondering:

would there be a faster way instead of for each cell?

would it be any faster testing for a blank cell and skipping it and going to the
next cell.

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default couple for each performance questions

Hi Gary,
Why you don;t use find methode ?

Rgds,
Halim

Gary Keramidas menuliskan:
i use a for each cell in range("L3:L33") statement. the previous code loads
about 40 workbooks, then cycles through 12 sheets using the for each statement.

it searches for an R or an A, can be either throughout the L3:L33 range. most
cells are blank, though. if it finds an R or A, it has to check offset(0,1) for
another value. i need to keep track of the counts of each of the 3.

i have the code working fine, so i don't really need code, just giving some
background on what i am doing. probably takes less than 2 seconds a workbook.

but i was wondering:

would there be a faster way instead of for each cell?

would it be any faster testing for a blank cell and skipping it and going to the
next cell.

--


Gary


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default couple for each performance questions


the bottleneck will be in opening the 40 workbooks.

make 1 book with external references to the originals.
update the values.
process the results thru vba.

Or use ExecuteExcel4Macro to retrieve the arrays incl 2nd column
from a closed workbook.

vArray = executeexcel4macro("'d:\path\[file.xls]sheet1'!R2C12:R33C13")

google a bit to find nice wrappers for the macro strings.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Gary Keramidas wrote in

i use a for each cell in range("L3:L33") statement. the previous code
loads about 40 workbooks, then cycles through 12 sheets using the for
each statement.

it searches for an R or an A, can be either throughout the L3:L33
range. most cells are blank, though. if it finds an R or A, it has
to check offset(0,1) for another value. i need to keep track of the
counts of each of the 3.

i have the code working fine, so i don't really need code, just
giving some background on what i am doing. probably takes less than 2
seconds a workbook.

but i was wondering:

would there be a faster way instead of for each cell?

would it be any faster testing for a blank cell and skipping it and
going to the next cell.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default couple for each performance questions

thanks, but a bit complicated for me. i'll stick to what i have, only takes 35
seconds.


--


Gary


"keepITcool" wrote in message
.com...

the bottleneck will be in opening the 40 workbooks.

make 1 book with external references to the originals.
update the values.
process the results thru vba.

Or use ExecuteExcel4Macro to retrieve the arrays incl 2nd column
from a closed workbook.

vArray = executeexcel4macro("'d:\path\[file.xls]sheet1'!R2C12:R33C13")

google a bit to find nice wrappers for the macro strings.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Gary Keramidas wrote in

i use a for each cell in range("L3:L33") statement. the previous code
loads about 40 workbooks, then cycles through 12 sheets using the for
each statement.

it searches for an R or an A, can be either throughout the L3:L33
range. most cells are blank, though. if it finds an R or A, it has
to check offset(0,1) for another value. i need to keep track of the
counts of each of the 3.

i have the code working fine, so i don't really need code, just
giving some background on what i am doing. probably takes less than 2
seconds a workbook.

but i was wondering:

would there be a faster way instead of for each cell?

would it be any faster testing for a blank cell and skipping it and
going to the next cell.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default couple for each performance questions

i tried the varray method you posted and i get a 2015 error when using the
range. if i just use R2C12, i get the value of the cell.

when i loop through a sheet using a variable (mnth & "'!R" & icell & "C12"), to
do 33 rows on 12 sheets it takes 4 or 5 seconds.
if i use the workbooks open and loop through, it takes less than a second,
because 40 workbooks takes about 35 seconds.

so, unless storing an array of values and then evaluating the array values is
faster, i guess i'll keep the workbooks open method.

thanks, maybe i can use this in the future, though.
--


Gary


"keepITcool" wrote in message
.com...

the bottleneck will be in opening the 40 workbooks.

make 1 book with external references to the originals.
update the values.
process the results thru vba.

Or use ExecuteExcel4Macro to retrieve the arrays incl 2nd column
from a closed workbook.

vArray = executeexcel4macro("'d:\path\[file.xls]sheet1'!R2C12:R33C13")

google a bit to find nice wrappers for the macro strings.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Gary Keramidas wrote in

i use a for each cell in range("L3:L33") statement. the previous code
loads about 40 workbooks, then cycles through 12 sheets using the for
each statement.

it searches for an R or an A, can be either throughout the L3:L33
range. most cells are blank, though. if it finds an R or A, it has
to check offset(0,1) for another value. i need to keep track of the
counts of each of the 3.

i have the code working fine, so i don't really need code, just
giving some background on what i am doing. probably takes less than 2
seconds a workbook.

but i was wondering:

would there be a faster way instead of for each cell?

would it be any faster testing for a blank cell and skipping it and
going to the next cell.





Reply
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
A couple of questions [email protected] Excel Discussion (Misc queries) 3 November 22nd 06 03:39 AM
Couple of Questions Toysforfids Excel Discussion (Misc queries) 4 September 14th 06 05:20 AM
Couple more questions... Poor microsoft user New Users to Excel 1 April 27th 05 03:20 PM
A couple of questions Orin Excel Programming 4 December 23rd 04 04:40 AM
A couple of questions Terry von Gease Excel Programming 3 August 16th 03 09:09 PM


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