Using Functions in VBA code

C

Chris Gorham

Hi,

I would like to use the funtion "rounddown" in some code that I'm writing.
The VBA help facility tells me that only "round" is available to me in VBA. I
believe that it is possible to import "rounddown" which is a function
available Excel s/sheet.

How do I do this...??

Thanks...Chris
 
B

bpeltzer

Range("A1").Value = Int(Range("A1").Value) will round the value in A1 down to
the next lowest integer.
 
C

chijanzen

Chris Gorham:

Try:

MsgBox Application.WorksheetFunction.RoundDown(Range("A1"), 2)

or

MsgBox Application.WorksheetFunction.RoundDown(100 / 33, 2)
 

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