Hi,
Try to avoid code like .Select. On the whole it's not needed. Address objects like ranges etc. directly and preface them with the VBA Sheet name. That's the VBA sheet name not the tab name. Below I'm using the VBA sheet code name Sheet2 which may of course be different to the sheets tab name.
In addition, whenever you find yourself creating looping code stop and think is this really necessary? Most of the time it isn't. Loops are inherently slow when they have to jump back and forth between VBA and the Excel application - there's a big time overhead at each pass through the loop.
In your case you appear to be wanting to infill blanks in column A using an earlier cell value in column A. This can be achieved with one line of code
In other situations where copying or deleting stuff is needed the fastest, most efficient and elegant way for this sort of stuff is to use an Autofilter to filter the rows you're interested in.
Then use syntax like
then paste to your destination cell.
This uses just one Copy / Paste instruction rather than many if you're looping through many cells.
Bookmarks