View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default faster way to do this?

Sorry about posting this to your message... I thought I was pointing at the
OP's message.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
The answer is "no" since you are changing the value of the elements.
However, if this is some intermediate step where the values have come from
or are going to be placed on a worksheet, you can eliminate the loop in
favor of a simple PasteSpecial operation; but you will need to tell us
more about what you are doing before we can offer code to you for one of
those situations.

--
Rick (MVP - Excel)


"Otto Moehrbach" wrote in message
...
Matt
Obviously if you cycle through less items, it will run quicker. If
ArrayB is a table on a sheet, you can divide each element of the table by
a simple copy - PasteSpecial - Divide. HTH Otto

"Matt S" wrote in message
...
I have this code right now:

For ii = 1 to 100
arrayA(ii) = arrayB(ii) / 10^4
Next ii

Is there a way to do this calculation faster? Maybe without cycling
thru
all elements of arrayA?

Thanks,
Matt