Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Rounding Entries From Range to Array

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default 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





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Rounding Entries From Range to Array

Thank you to all

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomly Re-arrange Entries in an array. james_tasker Excel Discussion (Misc queries) 1 February 10th 09 05:24 PM
rounding values in in array before sum Bruce Excel Worksheet Functions 4 January 31st 06 10:06 AM
Rounding in an array Pete Excel Discussion (Misc queries) 1 December 22nd 05 03:23 PM
How to count dates within a certain range in a column with mutiple date range entries Krisjhn Excel Worksheet Functions 2 September 1st 05 01:59 PM
Vertical Entries for VBA.Array cogent Excel Programming 3 April 22nd 04 03:52 AM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"