I'm trying put these Formulas in VBA so I don't have to worry about someone deleting the formula
if the have to delete a row or anything else that can cause the formula to break. I've tried to
Lock and Hide the formuals, but that doesn't work the way it needs to. This worksheet will be on
a shared drive for multiple to be able to access and work in.
The worksheet is these formulas are in is called InvTracker (this is in Sheet1). This is saved as .xlsm.
The Range goes from Row 2 to Row 5000 of the Columns I have listed next to the Formula.
I'm not sure if I need to insert a new module, or if I can add it to the existing Private Sub where
I have a Pivot Table to auto refresh.
**Code for reference:**
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Pivot for Avg Use").PivotTables("PivotTable3").PivotCache.Refresh
End Sub
Can anyone help me out? I've searched and tried several possibilities, but nothing has worked.
Column C =IF(B2="","",B2-DATE(YEAR(B2),1,1)+1)
Column G =IF(F2="","",VLOOKUP([@[Product Name]],'Vend_Prod (2)'!C:D,2,FALSE))
Column I =IF(G2="","",VLOOKUP(G2,'Vend_Prod (2)'!D:E,2,FALSE))
Column J =IF(H2="","",VLOOKUP([@[Product Name]],MaxStockQty!A:E,5,FALSE))
Column K =IF(F2="","",VLOOKUP([@[Product Name]],'Vend_Prod (2)'!C:H,6,FALSE))
Column L =IF(F2="","",VLOOKUP([@[Product Name]],'Vend_Prod (2)'!C:G,5,FALSE))
Column M =IF(H2="","",VLOOKUP([@[Product Name]],'Pivot for Avg Use'!A:D,3,FALSE))
Column N =IF(M2="","",J2/M2)
Column O =IF(N2="","",IF(N2>=L2+14,"No","Yes"))
Bookmarks