Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Easy Array Question...

You want a dynamic array, so
You have to do it in two steps

Dim DataArray() as Double
Dim iFinalCount as Long

iFinalcount = 200
Redim DataArray( 1 to iFinalCount)

--
Regards,
Tom Ogilvy

"Jeff Harbin" wrote in message
...
I've got an range of cells of varying size made up of predominately

doubles
with a few strings sprinkled amongst the doubles. I need to sort through

the
array, determine the number of doubles in the array, and then populate an
array with the doubles.

I thought I could loop through the cells count the number of doubles,

store
the number of doubles as a variable (iFinalCount), and then Dim an Array
using the iFinalCount variable like so...

Dim DataArray(1 to iFinalCount) as Double

When I try to run the code I get the following error:

Compile Error
Constant Expression required

If I hit Debug it takes me to the iFinalCount in the Array dimensioning
statement.

Btw...iFinalCount is defined as an integer

Thanks,

Jeff



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
Hopefully an easy question Yookaroo Excel Worksheet Functions 4 July 7th 09 08:31 PM
If - easy question mldancing Excel Discussion (Misc queries) 5 March 28th 07 01:26 PM
Easy question for you all holyearth Excel Worksheet Functions 3 May 1st 06 08:00 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
easy question Dahlman Excel Worksheet Functions 3 April 1st 05 11:11 PM


All times are GMT +1. The time now is 12:16 PM.

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

About Us

"It's about Microsoft Excel"