I posted a similar question here VBA Autofill hanging - quick debug but I've found on that forum that once your question is buried you usually don't get a response. (Otherwise pretty good forum)
I would appreciate your help. In VBA macro code, when I want to extend a formula down through a column, I use something like this:
This works fine if there is data on at least the next row (row 3 in this example). However, it gets buggy and strange when there is only data on the row the code is working on. That is, in this example, if there is only the header/column label row in row 1 and one row of data in row 2, then this code doesn't work well and seems to hang.Code:Range("H2").Select Selection.AutoFill Destination:=Range("H2:H" & Range("A2").End(xlDown).Row), Type:=xlFillDefault
What is the best way to extend formulas down through however many rows there are and not run into problems if there is only one data row?
Thanks!
(I was brought here via a link in Rick Rothstein's signature on a post he gave a great answer too (much better than mine!))




Reply With Quote

Bookmarks