Pivot Tables - Multiple Ranges
I'm using the SQL approach recommended above in a variety of ways to match,
update and sum data in ranges. While I'm close to getting the results I
want, a problem has come up that I wasn't experincing prior to using ADO/SQL.
The problem is that, while testing the program, I often have to delete a
few thousand records in my worksheet prior to testing a modified version of
the program. Deleting these records now takes an extraordinarily long time.
Sometimes an hour or longer. So long that I've tried to use cntl-break to
break out of the code to no avail. After the records finally delete and I
try my program again, Excel seems to be randomly recognizing cntl-breaks to
stop execution of the VBA code when I haven't hit a cntl-break. Re-starting
Excel doesn't seem to help. Re-starting Window (XP) does seem to get rid of
the cntl-break problem but doesn't help with the time issue of deleting
records. One more piece of background information is that my VBA code is
getting quite lengthy. Since I'm re-working an existing program, I've copied
all of the original subs from my old program into the new one so that any
subs that I can reuse are readily available. My questions a
1) Are the problems that I'm experiencing more likely related to using ADO
or the size of the program?
2) If the cause is likely using ADO, is there something that should be done
to free or clean up memory after each use to keep from causing performance
issues with deleting records?
Any help would be greatly appreciated.
Thanks in advance for your help.
"Tim Williams" wrote:
Glad to hear it was useful.
Tim
"Gr8lyConfused" wrote in message
...
Tim, I got this to work like I wanted on test data! This is powerful,
powerful stuff. I experimented with various types of SQL statements to
select and sum data ranges that I can use in other places in the
application
as well. This certainly seems far superior to the VBA coding that I was
doing that, at times, seemed like I was building the result one brick at a
time. Thanks again!!!!!
"Tim Williams" wrote:
"Microsoft ActiveX Data Objects 2.7 Library"
Earlier versions (eg. 2.5, 2.6) should also work.
Tim
.
|