Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

Create VBA function using worksheet functions?

$
0
0
Hello,

How do I create a VBA function using worksheet functions? For example, let's say I use the Macro Recorder and type in a worksheet function. In VBA, it creates a Procedure as opposed to a Function. For example, it may create this:

Code:

Sub dayttest()
    ActiveCell.FormulaR1C1 = _
        "=IF(DAY(RC[-11])<10,CONCATENATE(0,DAY(RC[-11])))"
End Sub

How do I convert that into a VBA function? I have a worksheet function that's very long and it would be nice if I just simplify it in VBA.

Thanks!

Viewing all articles
Browse latest Browse all 50061

Trending Articles