Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Range to array excluding null values

Hello,

Is there a way to create an array from a range with the formula
(varArray = RangeAddress) but excluding empty cells in the range (ot
any value)

It can be done by looping, but I am looking for the quick formula way

Thanks
avi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Range to array excluding null values

avi,

No need to use an array. You can directly address the cells of the range using:

Dim mcC As Range
For Each myC In Range("D2:D16").SpecialCells(xlCellTypeConstants, 23)
'whatever you want here
Next myC


--
HTH,
Bernie
MS Excel MVP


"avi" wrote in message
...
Hello,

Is there a way to create an array from a range with the formula
(varArray = RangeAddress) but excluding empty cells in the range (ot
any value)

It can be done by looping, but I am looking for the quick formula way

Thanks
avi



  #3   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Range to array excluding null values

Thanks but I really need it as an array for the rest of my application
Avi
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Range to array excluding null values

Avi,

Then you will need to loop through the cells as shown and assign the values
to the array, after using redim on the array to set the size.

Bernie

"avi" wrote in message
...
Thanks but I really need it as an array for the rest of my application
Avi



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
Min excluding zero values, without an array fomrula art Excel Worksheet Functions 13 May 25th 09 05:44 PM
How to return an array of values that are not zero/Null apache007 Excel Discussion (Misc queries) 9 May 15th 09 06:00 AM
How to return an array of values that are not zero/Null apache007 Excel Discussion (Misc queries) 0 May 8th 09 01:57 AM
Array keeps returning Null Values NormaD Excel Programming 2 June 21st 07 03:41 PM
Excluding NULL values in an Excel List Sheri Excel Programming 3 April 25th 05 03:48 PM


All times are GMT +1. The time now is 03:32 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"