View Single Post
 
Old 07-26-2016, 06:00 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Ah yes, that's because the code's using the equivalent of selecting cell B3 on the source sheet then on the keyboard, pressing End then down arrow, which with that source sheet with just a single line of data on row 3, was going right to the bottom of the sheet hence the long time taken. I've updated the code in several ways, principally to do the same from B2 instead of B3, but also, in case there are no lines of data at all, I've capped the number of rows it'll process to 10,000. I've also reduced the amount of code significantly.
See attached.
Reply With Quote