RogerRabbit2323
New Member
Hi,
New to the forum but wondering if anyone could help. I have inherited a vba database in excel with code i'm trying to edit without needing to rewrite.
The purpose of the database is to house transactions for customers. Users update templates which get pulled into a log sort and formatted and then update to the database which holds single/unique records with history.
It has quite alot of modules but one in particular runs extremely slow. This entire module deals with loading the templates into the log. Stepping through the code i can see that the below section of code is the reason. This problematic bit of code comes after the data in the templates are collated into one temporary 'holding file' and formatted. Everything before and after here takes seconds this section however can take upto hours depending kn the number of rows of data.
(1) What is it doing?
(2) Can i rewrite to do the same/similar thing but faster
I've tried just removing it but it has an impact on the overall sequence of code.
/////Problematic bit of code takes a long time run depending on number of records:
change_data is long
IN_UPDATE is a column name "update"
>>> use code - tags <<<
New to the forum but wondering if anyone could help. I have inherited a vba database in excel with code i'm trying to edit without needing to rewrite.
The purpose of the database is to house transactions for customers. Users update templates which get pulled into a log sort and formatted and then update to the database which holds single/unique records with history.
It has quite alot of modules but one in particular runs extremely slow. This entire module deals with loading the templates into the log. Stepping through the code i can see that the below section of code is the reason. This problematic bit of code comes after the data in the templates are collated into one temporary 'holding file' and formatted. Everything before and after here takes seconds this section however can take upto hours depending kn the number of rows of data.
(1) What is it doing?
(2) Can i rewrite to do the same/similar thing but faster
I've tried just removing it but it has an impact on the overall sequence of code.
/////Problematic bit of code takes a long time run depending on number of records:
change_data is long
IN_UPDATE is a column name "update"
>>> use code - tags <<<
Code:
For change_data = 1 To range_in.Rows.Count
range_in.Cells(change_data, IN_UPDATE).Value = Trim(CStr(rg_in.Cells(change_data, IN_UPDATE).Value))
Next change_data
Last edited by a moderator: