Hello,
I am trying to run the below function, the code itself executes without errors when I manually run it via the VBA editor. When I enter the function into the cell =EXSMSNG() it returns #VALUE!. Any clue what I am doing wrong? I am new to functions.
I am trying to run the below function, the code itself executes without errors when I manually run it via the VBA editor. When I enter the function into the cell =EXSMSNG() it returns #VALUE!. Any clue what I am doing wrong? I am new to functions.
Code:
Function EXSMSNG()
Dim relCell As String
relCell = ActiveCell.Offset(rowOffset:=0, columnOffset:=-1).Address(RowAbsolute:=False, ColumnAbsolute:=False)
ActiveCell.Formula = "=IF(COUNTIFS(Sheet2!B:B," & relCell & ",Sheet2!F:F,""N"")=1,""No appointment requested on BOL."",IF(COUNTIFS(Sheet2!B:B," & relCell & ",Sheet2!F:F,""Y"",Sheet2!AC:AC,0)=1,""Operations did not set appointment."",""Missed appointment.""))"
End Function