I recently developed a model for work and I am getting requests for adding additional features.
The problem isn't making the additions as most simply involve adding one or two additional columns. However, each time I add a column I must go through my code line by line and change every formula reference e.g. G to H, H to I, I to J etc.
Is there any way for me to automate this process without having to change each formula individually or a best practice that I can keep in mind when building my next model from scratch?
For example, let's say someone asks for an additional calculation that requires I insert a formula into column D. Currently I am going to each column (H, J, K, and L in the example below), and manually updating them to I, K, L, and M, respectively.
'Year 1 ASP formula = (Year 1 Bookings) / (Year 1 Units)
FormulaRange_ASP1 = "H23:H" & NumRows
Range(FormulaRange_ASP1).Value = "=IFERROR(G23/F23,0)"
Range(FormulaRange_ASP1).NumberFormat = "0.00"
Application.ScreenUpdating = False
'Year 2 AR Units formula = (Year 1 Units) * (Vlookup AR Retention Rate for product in column C)
FormulaRange_ARUnits2 = "J23:J" & NumRows
Range(FormulaRange_ARUnits2).Value = "=IF(E23 = 12,VLOOKUP(D23,$B$8:$F$19,4,FALSE),0) * F23 * AR_Opt_In"
Range(FormulaRange_ARUnits2).NumberFormat = "#,##0_)"
Application.ScreenUpdating = False
'Year 2 AR ASP formula = (Vlookup ASP for product in column C)
FormulaRange_AR_ASP2 = "K23:K" & NumRows
Range(FormulaRange_AR_ASP2).Value = "=IFERROR(VLOOKUP(D23,$B$8:$F$19,2,FALSE),0)"
Range(FormulaRange_AR_ASP2).NumberFormat = "0.00"
Application.ScreenUpdating = False
'Year 2 AR Bookings formula = (Year 2 Units) * (Year 2 ASP)
FormulaRange_AR_Bookings2 = "L23:L" & NumRows
Range(FormulaRange_AR_Bookings2).Value = "=J23 * K23"
Range(FormulaRange_AR_Bookings2).NumberFormat = "$#,##0_)"
Application.ScreenUpdating = False