Rounding Entries From Range to Array

M

marston.gould

I'm loading a range into an array by
using the statement:

Dim x As Variant
x = Range("NamedRange")

Is there a fast an easy way to round all of the items either
as they are loaded into the array or after? I need to round
it to 2 decimal places. Or do I have to loop through the entire array.
 
T

Tom Ogilvy

Looping through the array is what you have to do, but it isn't that slow
usually.
 
M

marston.gould

Thanks Tom .....
I'm surprised you don't ask for a fee for all this knowledge....
 
A

Alan Beban

Thanks Tom .....
I'm surprised you don't ask for a fee for all this knowledge....
Perhaps because after trying

x = Application.Round(Range("NamedRange"), 2)

a refund would be in order.

Alan Beban
 
T

Tom Ogilvy

Norm,
Appreciate the support and kind words, but I am willing to admit when I am
wrong. I am happy to be wrong in this case; apologize to Marston for the
misinformation and kudos to Alan for giving the correct response. I am
certainly willing to refund all that Marston has proferred. <g>

Regards,
Tom Ogilvy
 
A

Alan Beban

Aww shucks, Tom; now you've gone and outdone me in the felicitousness
department.

No harm intended; I just couldn't resist one that Marston so well teed up.

Alan Beban
 

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