Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bertha Ferguson   on Nov 25 In MS Office Category.

  
Question Answered By: Clint Garcia   on Nov 25

If I get you right, the data  you are extracting as a
range is all integers. You type  the variable  as
variant to create an array (and extract the data in
one fell swoop). Your problem then is that even though
the data is integer, the typing of variant is not accepted
by your other subroutine.

One workaround might be to create another variable (an array).
Dim it as aaNew() as Integer. Then, redim it once you know
the dimensions (unless they stay the same, then just dim it
as aaNew(rr,cc) as Integer. Then, copy, in a loop, data
from aaVariant.

The time consuming part is extracting data from Excel cells in
a loop. I too have experienced this -- dumping the mass range
is much much faster. However, I think that you'll find that
going from aaVariant to aaNew in a loop (array to array) will
happen in a nanosecond, so this extra step should not impact
your speed, and your other subroutine should like the data type.

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Changing data type Or get search suggestion and latest updates.


Tagged: