Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert formula with code dynamically
Hi all, Ok don't laugh (to hard). The goal is to insert a dynamic formula in Column 'I' Matching the last used cell in Column 'C'. By dynamic, i mean the formula should advance each cell downward. Private Sub Worksheet_Change(ByVal Target As Range) Dim rCell As Range Dim lLastrow As Long With lLastrow = .Range("C65536").End(xlUp).Row For Each rCell In .Range("I1:I" & lLastrow) If rCell.Offset(6, 0).Value < "" Then rCell.FormulaR1C1 = "=IF(D2="","",(H2/G2))" End If Next rCell End With End Sub -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=504764 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula, Macro, or VBA code to find and insert | Excel Worksheet Functions | |||
Insert a specified number of rows dynamically | Excel Worksheet Functions | |||
Insert autoforms and objects dynamically | Excel Programming | |||
Code to Insert Formula in Cell | Excel Programming | |||
Dynamically insert a picture. | Excel Programming |