Thread: wrap text
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default wrap text

You're welcome.
An optimization: the Trim() function is playing no role whatsoever. I
often use it when dealing with string input as a form of defensive
programming but in this case it is defending against nothing since
Val() seems to be indifferent to any leading or trailing whitespace (as
a bit of experimenting in the immediate window shows). Thus the line
sum = sum + Val(Trim(Vals(i)))
could be replaced by
sum = sum + Val(Vals(i))
without changing the functionality. It could make a slight but
noticable difference in calculation time if used with large data sets.

Happy New Year

-John Coleman

bijan wrote:
Thank you John