+ Reply to Thread
Results 1 to 2 of 2

Error: Sub or function not defined

  1. #1
    cwilliams
    Guest

    Error: Sub or function not defined

    I'm new in writing VBA and for the first time I tried to call an Excel
    function from the VBA code and I received the error above. Here is the
    statement:

    Dim StartRowIndex(1 To 6)
    Dim xAxisScaleMin(1 To 6)
    xAxisScaleMin(i) = RoundDown(StartRowIndex(i) * 1440, 0) / 1440

    I'm confused! I assumed that since the Rounddown function is a predefined
    excel worksheet function it would work in VBA. What do I have to do?

  2. #2
    Norman Jones
    Guest

    Re: Error: Sub or function not defined

    Hi C,

    RoundDown is an Excel function, not a VBA function.

    Try, therefore:

    Application.WorksheetFunction.RoundDown


    ---
    Regards,
    Norman



    "cwilliams" <[email protected]> wrote in message
    news:[email protected]...
    > I'm new in writing VBA and for the first time I tried to call an Excel
    > function from the VBA code and I received the error above. Here is the
    > statement:
    >
    > Dim StartRowIndex(1 To 6)
    > Dim xAxisScaleMin(1 To 6)
    > xAxisScaleMin(i) = RoundDown(StartRowIndex(i) * 1440, 0) / 1440
    >
    > I'm confused! I assumed that since the Rounddown function is a predefined
    > excel worksheet function it would work in VBA. What do I have to do?




+ Reply to Thread

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