User() Function

A

Arvi Laanemets

Hi

So what?

In general:
Function MyFunc(Parameter1 As Par1Type, ...) As RetValType
' Volatile is needed to make the function react immediately to changes
on worksheet
Application.Volatile
' You can have any number of command lines (code), you need to calculate
the return value, here. But beware that nothing in workbook is changed -
changing active cell or sheet, or overwriting cell vlaues or formats etc.
are not allowed in functions
[Your code]
'Return value must be saved to variable with name same as function name,
in last code row
MyFunc=LastExpression
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top