ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rounding Entries From Range to Array (https://www.excelbanter.com/excel-programming/312421-rounding-entries-range-array.html)

[email protected]

Rounding Entries From Range to Array
 
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.


Tom Ogilvy

Rounding Entries From Range to Array
 
Looping through the array is what you have to do, but it isn't that slow
usually.

--
Regards,
Tom Ogilvy

" wrote in message
oups.com...
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.




[email protected]

Rounding Entries From Range to Array
 
Thanks Tom .....
I'm surprised you don't ask for a fee for all this knowledge....


Alan Beban[_2_]

Rounding Entries From Range to Array
 
wrote:
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

Tom Ogilvy

Rounding Entries From Range to Array
 
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




"Norman Jones" wrote in message
...
Hi Alan,

Independently of the possible merit of your suggestion, I am sure that you
could have composed your response more felicitously.

Tom certainly needs no defence from me. However, were I faced with an

urgent
project and only a single source of help, I could wish for nothing better
than for the source of that help to be Tom. The choice is quite simply a
no-brainer.

Curmudgeons (with one notable exception) rarely receive the respect and
recognition that they might otherwise deserve.


---
Regards,
Norman



"Alan Beban" wrote in message
...
wrote:
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






Norman Jones

Rounding Entries From Range to Array
 
Hi Tom,

I am certainly willing to refund all that Marston has proferred. <g



I like Norman Harker's version:

It comes with the usual full money back if not delighted guarantee;
"You pay nothing for it and you'll get nothing back!"


---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
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




"Norman Jones" wrote in message
...
Hi Alan,

Independently of the possible merit of your suggestion, I am sure that
you
could have composed your response more felicitously.

Tom certainly needs no defence from me. However, were I faced with an

urgent
project and only a single source of help, I could wish for nothing better
than for the source of that help to be Tom. The choice is quite simply a
no-brainer.

Curmudgeons (with one notable exception) rarely receive the respect and
recognition that they might otherwise deserve.


---
Regards,
Norman



"Alan Beban" wrote in message
...
wrote:
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








Alan Beban[_2_]

Rounding Entries From Range to Array
 
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

Tom Ogilvy wrote:

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




"Norman Jones" wrote in message
...

Hi Alan,

Independently of the possible merit of your suggestion, I am sure that you
could have composed your response more felicitously.

Tom certainly needs no defence from me. However, were I faced with an


urgent

project and only a single source of help, I could wish for nothing better
than for the source of that help to be Tom. The choice is quite simply a
no-brainer.

Curmudgeons (with one notable exception) rarely receive the respect and
recognition that they might otherwise deserve.


---
Regards,
Norman



"Alan Beban" wrote in message
...

wrote:

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






[email protected]

Rounding Entries From Range to Array
 
Thank you to all



All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com