Hi,
I am running the following code that checks for text in column "A" and inserts several formulas into different cells if "A" contains some text.
This all works fine and I don't wish to change anything except i cannot work out how to incorporate the IFERROR formula in so that the DIV/o error doesn't show. Any ideas????
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Long
n = Range("AveragePrice")(1).Row
Range("AveragePrice").Formula = "=IF(ISBLANK(A" & n & "),"""",SUM(G2/E2))"
Range("TotSales").Formula = "=IF(ISBLANK(A" & n & "),"""",SUMIF(Detail!A:H,A2,Detail!E:E))"
Range("CellarVar").Formula = "=IF(ISBLANK(A" & n & "),"""",SUM(D2*Detail!AB2*Detail!AC2))"
Range("BarNet").Formula = "=IF(ISBLANK(A" & n & "),"""",SUMIF(Detail!A:H,A2,Detail!H:H))"
End Sub
Thanks
Bookmarks