Hi,
check attached example, each time the value in C$ is changed the formulas are reapplied, at the same time the user can write values into C9-C11: Sample_Maintanance_Cost.xlsm
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C4")) Is Nothing Then
Range("C9").FormulaR1C1 = "=IF(R[-5]C=""*Other"","""",INDEX(Data!R[-7]C[-1]:R[-2]C[2],MATCH(DataEntry!R[-5]C,Data!R[-7]C[-1]:R[-2]C[-1],0),MATCH(DataEntry!RC[-1],Data!R[-7]C[-1]:R[-7]C[2],0)))"
Range("C10").FormulaR1C1 = "=IF(R[-6]C=""*Other"","""",INDEX(Data!R[-8]C[-1]:R[-3]C[2],MATCH(DataEntry!R[-6]C,Data!R[-8]C[-1]:R[-3]C[-1],0),MATCH(DataEntry!RC[-1],Data!R[-8]C[-1]:R[-8]C[2],0)))"
Range("C11").FormulaR1C1 = "=IF(R[-7]C=""*Other"","""",INDEX(Data!R[-9]C[-1]:R[-4]C[2],MATCH(DataEntry!R[-7]C,Data!R[-9]C[-1]:R[-4]C[-1],0),MATCH(DataEntry!RC[-1],Data!R[-9]C[-1]:R[-9]C[2],0)))"
End If
End Sub
Bookmarks