Hello all!
Over 2 years ago, I developed a macro for my firm in order to format raw data output from our inventory database into a formatted and polished file we could send externally to clients. It always ran a bit slow (around 5 minutes), but other than that we had no issues. We recently changed from Office 2016 to Office 365, and around the same time people started noticing spikes in the macro run time of over 10 minutes. No changes had been made to the code itself, but all of a sudden the runtime became astronomical. I went back in to the file and cleaned up the macro in an attempt to improve speeds. It seemed to work well, with run times for smaller files down around 1 minute, but larger files are still taking 10 minutes or more. I believe the bulk of the time is spent performing the last function of the macro which is an If, Then function. When re-writing I tried to limit the number of cells being checked using a LastRow function, but I'm not sure I got it quite right. I'm going to post the code below. Maybe someone will see something that I'm not. I'm not an expert with VBA, so any input or feedback would be extremely helpful!
Please Login or Register to view this content.
Bookmarks