Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
AutoFill Formula with code
Hi all, This whole thing needs to change based on the last used cell in column C. There is a formula in: G2 '=IF(D2="","",(D2*F2)) I2 '=IF(D2="","",(H2/G2)) J2 '=IF(E2="","",(H2/E2)) Want to Auto Fill the formulas down, but only down as far as the last used cell in column C. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 3 Then With Cells(Rows.Count, 3).End(xlUp).Select Range("g2").AutoFill Destination:=Range("g3 to ???????") Range("I2").AutoFill Destination:=Range("I3 to ???????") Range("J2").AutoFill Destination:=Range("J3 to ???????") End With End If End Sub Any Direction would be great. -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=509141 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill data based on an assigned code/prefix | Excel Worksheet Functions | |||
Autofill formula to next row | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
VBA code to Autofill one cell to many rows below where row count will change | Excel Programming | |||
Q. Autofill question: Can I autofill alpha characters like I can numbers? | Excel Programming |