![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
I have a workbook in which I import data into column L. I have a formula for the column. The issue is sometimes there is a large difference in the amount of rows that are imported into the column. Is there a way for excel to automatically autofill my formula into the cells with data so I don't have to do it manually everytime.
Thanks |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Lenny
There is bound to be, how about something like: Code:
Range("L2", Range("L65536").End(xlUp)).FormulaR1C1 = _
"=SUM(R[-2]C[1]:R[7]C[1])"
Code:
Range("L2", Range("L65536").End(xlUp)).Offset(0, 1).FormulaR1C1 = _
"=SUM(R[-2]C[1]:R[7]C[1])"
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi. If you have Formulas in columns "M",
Please copy this into a standard module. Sub MyAutoFill() Range("M1").AutoFill Range("M1", Range("L65536").End(xlUp).Offset(, 1)) End Sub |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|