Results 1 to 6 of 6

Create VBA function using worksheet functions?

Threaded View

  1. #1
    Registered User
    Join Date
    12-23-2010
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    66

    Create VBA function using worksheet functions?

    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:

    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!
    Last edited by Leith Ross; 12-27-2012 at 07:53 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1