I thought about that issue but discounted it because I saw exampls on
the web like evaluate("sin(45)") which I considered morally
equivalent.
I guess not.   So what do you think adding the ROW(), here is doing
exactly?   It does work for me too.

On Thu, Apr 12, 2012 at 12:21 AM, Asa Rossoff <a...@lovetour.info> wrote:
> Heck,
>    IF(ROW(),ROUND(range))
> works.
>
> -----Original Message-----
> From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
> On Behalf Of Asa Rossoff
> Sent: Thursday, April 12, 2012 12:13 AM
> To: excel-macros@googlegroups.com
> Subject: RE: $$Excel-Macros$$ Argh. Previously posted evaluate function
> replacing loop has unnoticed major error
>
> Just got a post on the other forum that said (to his recollection) if you
> Evaluate a function that doesn't expect an array argument, you have to
> pursuade Evaluate to evaluate it as an array formula, such as with INDEX as
> I first did, or this other suggested alternative:
>    IF(ROW(range),ROUND(range))
>
> I just tested that one and it worked fine.  Should be more efficient than
> the double transpose.
>
> If that works, I'm a little surprised that including an array constant in
> the expression doesn't in itself work.  Something I had tried.
>
> Asa
>
> -----Original Message-----
> From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
> On Behalf Of Domain Admin
> Sent: Wednesday, April 11, 2012 7:24 PM
> To: excel-macros@googlegroups.com
> Subject: Re: $$Excel-Macros$$ Argh. Previously posted evaluate function
> replacing loop has unnoticed major error
>
> Well Holmes you've done it again.  Funny I tried to use round on a
> range in the worksheet too I could not get it to work.
> Putting the round into a vacant cell of course would not work and I
> could not figure out how to have it operate on
> the existing cells in place.
>
> On Wed, Apr 11, 2012 at 7:13 PM, Asa Rossoff <a...@lovetour.info> wrote:
>> - I tried the formula on a worksheet range do double check it correctly
>> returned the desired array. it did.
>> - I assumed Excel had some kind of special handling of the formula given
>> that caused it to just return one element from the array...
>> - I tried to modify the formula to see if it avoided the special
> handling...
>> - I tried making the formula a more complex expression, like:
>>   round(range,2)
>>   +round(range,2)
>>   round(range,2)*1
>>   round(range*1,2)
>>   int(range*100+0.5)/100
>> - with no luck, I tried for an expression that can return part of an array
>>   index(round(range,2),,1)
>> - YAY. Ohh, more than one column needed :(
>> - I made the leap to an expression that uses function(s) to simply return
>> the same array it is given
>>   offset(round(range,2),,)
>> - no, no, offset only works on ranges, not arrays...
>>   transpose(transpose( ....
>>
>> Best answer I can come up with :)
>> Asa
>>
>> -----Original Message-----
>> From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
>> On Behalf Of Domain Admin
>> Sent: Wednesday, April 11, 2012 6:57 PM
>> To: excel-macros@googlegroups.com
>> Subject: Re: $$Excel-Macros$$ Argh. Previously posted evaluate function
>> replacing loop has unnoticed major error
>>
>> Just curious how you ever even thought of trying the double transpose.
>>
>> On Wed, Apr 11, 2012 at 6:51 PM, Asa Rossoff <a...@lovetour.info> wrote:
>>>> Whatever would make you think of it that being the case?
>>> Sorry, makes me think of what being the case?
>>>
>>> -----Original Message-----
>>> From: excel-macros@googlegroups.com
> [mailto:excel-macros@googlegroups.com]
>>> On Behalf Of Domain Admin
>>> Sent: Wednesday, April 11, 2012 6:18 PM
>>> To: excel-macros@googlegroups.com
>>> Subject: Re: $$Excel-Macros$$ Argh. Previously posted evaluate function
>>> replacing loop has unnoticed major error
>>>
>>> Whatever would make you think of it that being the case?
>>>
>>> So if redim preserve will only let you extend the column value which
>>> I do not get as that is almost never what anyone would want, can you
>>> transpose the array, do the redim, then transpose back?
>>>
>>> On Wed, Apr 11, 2012 at 6:10 PM, Asa Rossoff <a...@lovetour.info> wrote:
>>>> rounding a range results in an array.  Evaluate evaluates array formulas
>>> and
>>>> returns array results.  So, the fact that it didn't with the simple
> ROUND
>>>> formula is strange.  transpose switches rows for columns, and a second
>>>> transpose switches them back.  So you get the original array.  No idea
>> why
>>>> this was needed..
>>>>
>>>> -----Original Message-----
>>>> From: excel-macros@googlegroups.com
>> [mailto:excel-macros@googlegroups.com]
>>>> On Behalf Of Domain Admin
>>>> Sent: Wednesday, April 11, 2012 6:02 PM
>>>> To: excel-macros@googlegroups.com
>>>> Subject: Re: $$Excel-Macros$$ Argh. Previously posted evaluate function
>>>> replacing loop has unnoticed major error
>>>>
>>>> Ok that does appear to work, but I don't get it.  How does nested
>>>> transposes function
>>>> to make this work correctly?  It would appear to the novice that all
>>>> you did was transpose
>>>> it then transpose it back then whatever...
>>>>
>>>> Is transposing an array the answer to my other new post about redim
>>>> preserve?
>>>>
>>>> On Wed, Apr 11, 2012 at 5:53 PM, Asa Rossoff <a...@lovetour.info> wrote:
>>>>> To retrieve a multi-column array I resorted to
>>>>> "transpose(transpose(round(a1:b10,2)))" form.
>>>>>
>>>>>
>>>>>
>>>>> From: Asa Rossoff [mailto:a...@lovetour.info]
>>>>> Sent: Wednesday, April 11, 2012 5:18 PM
>>>>> To: 'excel-macros@googlegroups.com'
>>>>> Subject: RE: $$Excel-Macros$$ Argh. Previously posted evaluate function
>>>>> replacing loop has unnoticed major error
>>>>>
>>>>>
>>>>>
>>>>> Hi Howard,
>>>>>
>>>>> Seems like an Excel bug.. Sorry for not testing the suggestion.
>> Evaluate
>>>>> may not be fully documented for a reason.  However, it is a great
> useful
>>>>> function, just if you aren't getting the result you expect, you may
> have
>>>> to
>>>>> look for a workaround.  I just posted a query in a developers forum
> with
>>>>> aomse big hitters to see if I can get an explanation for what you're
>>>> seeing,
>>>>> but in the meantime, here is a workaround.
>>>>>
>>>>>
>>>>>
>>>>> 1.       What you've seen with your use of Evaluate is evaluate
>> returning
>>>>> only a single value -- the first value in the array, rather than the
>>> whole
>>>>> array as Evaluate usually does.
>>>>>
>>>>> 2.       The INDEX function can be use to extract a reference to any
>>>>> position in an array, or a whole row or column from an array.
>>>>>
>>>>> 3.       Here is a modification of your statement that works in my test
>>> by
>>>>> using index to specify to return the first column from the array (which
>>> of
>>>>> course is the whole array in this case):
>>>>>
>>>>> tmprange.Value2 = .Evaluate("index(round(" & tmprange.Address &
>>> ",2),,1)")
>>>>>
>>>>>
>>>>>
>>>>> I used Value2 since it's usually faster, but you can use Value if you
>>>>> prefer.  INDEX is the relevant change.
>>>>>
>>>>>
>>>>>
>>>>> Asa
>>>>>
>>>>>
>>>>>
>>>>> From: excel-macros@googlegroups.com
>>> [mailto:excel-macros@googlegroups.com]
>>>>> On Behalf Of tangledweb
>>>>> Sent: Wednesday, April 11, 2012 2:28 PM
>>>>> To: excel-macros@googlegroups.com
>>>>> Subject: $$Excel-Macros$$ Argh. Previously posted evaluate function
>>>>> replacing loop has unnoticed major error
>>>>>
>>>>>
>>>>>
>>>>> I used the evaluate function below to replace the commented out loop
>>>> portion
>>>>> for better performance in rounding off all the cells in a range.
>>>>>
>>>>> It was certainly fast and it performed the round function correctly but
>>> it
>>>>> also replaced every single cell in the range with the value of the
> first
>>>>>
>>>>> cell (ok you can laugh now).  Any idea what is wrong with it?  Kind of
>>>> hard
>>>>> to debug a single line of code.
>>>>>
>>>>>
>>>>>
>>>>>     With Sheets(RawData)
>>>>>         Set tmprange = .Range(.Cells(2, 3), .Cells(stoprawdata, 7))
>>>>>         tmprange.Value = .Evaluate("round(" & tmprange.Address & ",2)")
>>>> 'use
>>>>> evaluate instead of code below
>>>>> '        For Each onecell In tmprange
>>>>> '            onecell.Value = WorksheetFunction.Round(onecell, 2)
>>>>> '        Next onecell
>>>>>     End With
>>>>>
>>>>> --
>>>>> FORUM RULES (986+ members already BANNED for violation)
>>>>>
>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>>> will
>>>>> not get quick attention or may not be answered.
>>>>>
>>>>> 2) Don't post a question in the thread of another member.
>>>>>
>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>> measure.
>>>>>
>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>
>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>>>>> signatures are prohibited.
>>>>>
>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>> Forum
>>>>> owners and members are not responsible for any loss.
>>>>>
>>>>>
>>>>
>>>
>>
> ----------------------------------------------------------------------------
>>>> --------------------------
>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>
>>>>> --
>>>>> FORUM RULES (986+ members already BANNED for violation)
>>>>>
>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>>> will
>>>>> not get quick attention or may not be answered.
>>>>>
>>>>> 2) Don't post a question in the thread of another member.
>>>>>
>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>> measure.
>>>>>
>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>
>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>>>>> signatures are prohibited.
>>>>>
>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>> Forum
>>>>> owners and members are not responsible for any loss.
>>>>>
>>>>>
>>>>
>>>
>>
> ----------------------------------------------------------------------------
>>>> --------------------------
>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>
>>>> --
>>>> FORUM RULES (986+ members already BANNED for violation)
>>>>
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>> will
>>>> not get quick attention or may not be answered.
>>>>
>>>> 2) Don't post a question in the thread of another member.
>>>>
>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>> measure.
>>>>
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>
>>>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>>>> signatures are prohibited.
>>>>
>>>> NOTE  : Don't ever post personal or confidential data in a workbook.
>> Forum
>>>> owners and members are not responsible for any loss.
>>>>
>>>>
>>>
>>
> ----------------------------------------------------------------------------
>>>> --------------------------
>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>
>>>> --
>>>> FORUM RULES (986+ members already BANNED for violation)
>>>>
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will
>>> not get quick attention or may not be answered.
>>>>
>>>> 2) Don't post a question in the thread of another member.
>>>>
>>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>>>
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>
>>>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>>> signatures are prohibited.
>>>>
>>>> NOTE  : Don't ever post personal or confidential data in a workbook.
>> Forum
>>> owners and members are not responsible for any loss.
>>>>
>>>>
>>>
>>
> ----------------------------------------------------------------------------
>>> --------------------------
>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>> --
>>> FORUM RULES (986+ members already BANNED for violation)
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will
>>> not get quick attention or may not be answered.
>>>
>>> 2) Don't post a question in the thread of another member.
>>>
>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>>
>>> 4) Acknowledge the responses you receive, good or bad.
>>>
>>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>>> signatures are prohibited.
>>>
>>> NOTE  : Don't ever post personal or confidential data in a workbook.
> Forum
>>> owners and members are not responsible for any loss.
>>>
>>>
>>
> ----------------------------------------------------------------------------
>>> --------------------------
>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>> --
>>> FORUM RULES (986+ members already BANNED for violation)
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will
>> not get quick attention or may not be answered.
>>>
>>> 2) Don't post a question in the thread of another member.
>>>
>>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>>
>>> 4) Acknowledge the responses you receive, good or bad.
>>>
>>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>>
>>> NOTE  : Don't ever post personal or confidential data in a workbook.
> Forum
>> owners and members are not responsible for any loss.
>>>
>>>
>>
> ----------------------------------------------------------------------------
>> --------------------------
>>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will
>> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
> ----------------------------------------------------------------------------
>> --------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>>
>> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>>
>>
> ----------------------------------------------------------------------------
> --------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5)  Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
> ----------------------------------------------------------------------------
> --------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5)  Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
> ----------------------------------------------------------------------------
> --------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
> Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not 
> get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5)  Cross-promotion of, or links to, forums competitive to this forum in 
> signatures are prohibited.
>
> NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
> owners and members are not responsible for any loss.
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to