Hi all. First post here.
I use Excel every day at work and felt like learning VBA was a good step for me. I've written a program that I'd like you guys to critique as to its efficiency / any other points that I could learn from.
My number one problem is that it goes to slow. I've programmed in assembly with microcontrollers that operate at 4Mhz or so and I feel like with all this computing power the program takes WAY to long to run when it is dealing with large ranges.
What it's for:
I have to reconcile some large bank accounts every month, where millions of dollars move through in hundreds of different transactions. I needed something to match up values that appear in our ledger and values that appear on our bank statement, then identify values that don't match.
How the program goes about it:
It prompts me to select each range of values, then looks at each value in range A (copyRange), compares it to values in range B (findRange) and then colors values using the color in cell A1 for each time it is found in the opposite range, and vice versa.
It then uses the "ColorSum" UDF that I found on the internet to sum each cell in each range that has been highlighted, and then show the user that the values match with a message box. The user can select for the program to generate a report, which then selects a new sheet and creates an array of values from each range that has not been highlighted, and places them on the new sheet.
I know this code isn't efficient. If I have a small number of values, say, 400 in each range, it takes about 4 seconds to run. This isn't all that unreasonable, but as a matter of learning I'd like to find out how to make it faster. If I were to use this program on, say, 20,000 values in each range, it will take several minutes to run. Thanks!
Bookmarks