Hi,
I wanted to round down/up in vba without using the worksheet function, as this is kind of slow. Is there a premade function someone has access too?
I'm kind of surprised excel never made one for vba.
for example in C++ I wrote:
double dblRoundUp(double x, int pp)
{
int i = 1;
double xx = 1;
for (i = 1; i <= pp; i++) //This is faster then using the power function
{ xx = 10 * xx; }
return int(x * xx + .9999999) / xx;
}
Thanks
Jeff
I wanted to round down/up in vba without using the worksheet function, as this is kind of slow. Is there a premade function someone has access too?
I'm kind of surprised excel never made one for vba.
for example in C++ I wrote:
double dblRoundUp(double x, int pp)
{
int i = 1;
double xx = 1;
for (i = 1; i <= pp; i++) //This is faster then using the power function
{ xx = 10 * xx; }
return int(x * xx + .9999999) / xx;
}
Thanks
Jeff