Error: Sub or function not defined

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Hi C,

RoundDown is an Excel function, not a VBA function.

Try, therefore:

Application.WorksheetFunction.RoundDown
 

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

Back
Top