Hi all
I am using the code below to replace the formula in a cell with a BeforeDoubleClick event but I am getting a syntax error. (Ex: If a cell is missing the formula, I just double click it to replace the formula)
This is the formula that I am trying to paste:
=IF(C4="",F3,IFERROR(INDEX(Instruments!Z$3:Z$68,MATCH(CI4,Instruments!AA$3:AA$68,0))+F3,""))
This formula is in the first cell and it needs to be relative when it is pasted in any cell in the column that I double click.
I would like to be able to do it this way but I could probably just have code that just copies the formula from the cell above from where I double click.
Thank you in advance!
I am using the code below to replace the formula in a cell with a BeforeDoubleClick event but I am getting a syntax error. (Ex: If a cell is missing the formula, I just double click it to replace the formula)
This is the formula that I am trying to paste:
=IF(C4="",F3,IFERROR(INDEX(Instruments!Z$3:Z$68,MATCH(CI4,Instruments!AA$3:AA$68,0))+F3,""))
This formula is in the first cell and it needs to be relative when it is pasted in any cell in the column that I double click.
Code:
If Not Intersect(Target, Range("F:F")) Is Nothing Then 'change this column to suit
Target.Formula = "=IF(C" & ActiveCell.Row & ="",F" & ActiveCell.Row & ,IFERROR(INDEX(Instruments!Z$3:Z$68,MATCH(CI" & ActiveCell.Row & ,Instruments!AA$3:AA$68,0))+F3,""))"
Target.Offset(1, 0).Select
End If
I would like to be able to do it this way but I could probably just have code that just copies the formula from the cell above from where I double click.
Thank you in advance!