View Single Post
 
Old 09-23-2016, 04:54 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Assuming what you have works, you already have an autofill for column "D" that fills to row 8000.
I guess your question is what to replace the 8000 with for autfilling in column "E"

That's what this part of my suggestion calculates, it's 1 row before the first row holding the lower data in column "E".
Code:
Cells(2, "E").End(xlDown).Row - 1
So, where you have the macro putting the formula into E2, and then selecting E2,
add the following line after those ones and see if it works.
Code:
Selection.AutoFill Destination:=Range("E2:E" & Cells(2, "E").End(xlDown).Row - 1)
Reply With Quote