ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FillDown (https://www.excelbanter.com/excel-programming/282850-filldown.html)

Mike Fogleman

FillDown
 
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?



Tom Ogilvy

FillDown
 
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.


--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
...
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?





Mike Fogleman

FillDown
 
Duh! Change the Offset column number. Thanks, Tom, for the slap.
"Tom Ogilvy" wrote in message
...
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.


--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
...
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?








All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com