FillDown

M

Mike Fogleman

What is happening with this code to FillDown a formula in one column to a
point where another column ends?

Range("E1").Formula = MyFormula
Range("E1", Range("A1").End(xlDown)).Offset(0, 1).FillDown

Any data that may be in columns B:D are all changed to whatever is on row 1
of the column. Only column A will always be a complete list so that needs to
be criteria for filling down. The code works great if the FillDown column is
next to column A, but not if it points across other columns of data. How can
I do this without re-arranging my data columns?
 
T

Tom Ogilvy

Sub tester1()
myFormula = "=sum(A1:D1)"
Range("E1").Formula = myFormula
Range("E1", Range("A1").End(xlDown).Offset(0, 4)).FillDown

End Sub

Will filldown column E.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top