Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
Code such as the one below copies formulas in the last cells of columns 3 and 10 down to the new rows when inserted. However, I need to allow the user to overwrite the formula in column 3 with any text value. If the user overwrites this formula on the last row, and then manually goes to a new row, then the code below doesn't work (it simply copies what value is in the above cell). Is there a way for code search upward in columns 3 and 10 until it reaches the last cells with formulas, and apply the formulas to the new cells in columns 3 and 10 on the new row? Or, is there a way to store the formulas: =IF(A21<"",B21,"") in column 3 =IF(B21<0,IF(C21<B21,A21&", "&LEFT(C21,2),A21&", "&LEFT(B21,1)),"") in column 10 behind the worksheet? 'This code carries formulas down from the previous row but does not 'take into consideration if the formula has been overwritten in the row above. If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub On Error GoTo CleanUp: With Target If .Value < "" Then Application.EnableEvents = False .Offset(0, 3).FormulaR1C1 = "=RC[-1]=R2C3" .Offset(0, 10).FormulaR1C1 = "=RC[-1]=R2C10" End If End With CleanUp: Application.EnableEvents = True Thanks a lot! Eric |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search a range to find cells containing formulas | Excel Programming | |||
Can Excel recognize when data is entered and apply formulas? | Excel Worksheet Functions | |||
how do I search for any cell containing data and apply conditiona. | Excel Discussion (Misc queries) | |||
Go to record found by Criteria in Data Form | Excel Programming | |||
Current row/record shown when opening data/form | Excel Programming |