Hi,
I am trying to create this custom formula in a template file to count bytes in a string but when running it, it highlights "INDIRECT" as not defined.
VBA:
and here is the Excel formula working perfectly:
Is there an easy way to let my colleages use this formula in an easy way? your help will be highly appreciated.
Cheers,
I am trying to create this custom formula in a template file to count bytes in a string but when running it, it highlights "INDIRECT" as not defined.
VBA:
VBA Code:
Public Function ByteCount(text As String)
ByteCount = IfError(Sum(IIf(Unicode(Mid(text, Row(INDIRECT("1:" & Len(text))), 1)) < 128, 1, IIf(Unicode(Mid(text, Row(INDIRECT("1:" & Len(text))), 1)) < 2048, 2, IIf(Unicode(Mid(text, Row(INDIRECT("1:" & Len(text))), 1)) < 65536, 3, 4)))), 0)
End Function
and here is the Excel formula working perfectly:
Excel Formula:
=IFERROR(SUM(
IF(UNICODE(MID(A3;ROW(INDIRECT("1:"&LEN(A3)));1))<128; 1;
IF(UNICODE(MID(A3;ROW(INDIRECT("1:"&LEN(A3)));1))<2048; 2;
IF(UNICODE(MID(A3;ROW(INDIRECT("1:"&LEN(A3)));1))<65536; 3; 4
))));0)
Is there an easy way to let my colleages use this formula in an easy way? your help will be highly appreciated.
Cheers,