Vba excel 2013 returning zero when executing rng.value=""
Function Delete_UDF(rng)
ThisWorkbook.Application.Volatile
rng.Value = ""
End Function
This is returning zero, anyone knows why?
Vba excel 2013 returning zero when executing rng.value=""
Function Delete_UDF(rng)
ThisWorkbook.Application.Volatile
rng.Value = ""
End Function
This is returning zero, anyone knows why?
Your function does not return anything. You need to add something like:
Delete_UDF = "return value"
Your use of Application.Volatile tells me you are using this UDF on a worksheet and this will never work from the worksheet.
A UDF called from the worksheet cannot change any cell on that worksheet or other worksheet other than returning a value to the cell it is being used on. If you used this in A1 like =Delete_UDF(A1)
it would be a circular reference and not work for that reason.
This will never work as a UDF on the worksheet.