+ Reply to Thread
Results 1 to 6 of 6

Re-Setting the dimension of an array to exclude #NA values

  1. #1
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re-Setting the dimension of an array to exclude #NA values

    Hi guys,

    I have an array ( n rows, 2 columns) that is filled in by values from two other arrays (dim_tag,1) and (dim_iban,1) based on a condition within a loop .
    Following, my code the final dimension of my array is (dim_tag,2) however since the condition is not always met the values in the array can be #NA.
    How can I size the dimensions of my array that it eliminates #NA and its dimension corresponds to the number of times the condition is fit.
    I tried to play around the Redim and ReDim Preserve, by sometimes declaring a fixed dimension and Redim and sometimes no fixed and Redim. I get error 9 subscript out of Range or array already dimensioned.

    Any help how can I get clean array corresponding to real values ?

    Many Thx.

    Najwa.

    HTML Code: 

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Re-Setting the dimension of an array to exclude #NA values

    Try something like this

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Re-Setting the dimension of an array to exclude #NA values


    Salut !

    Quote Originally Posted by Najwa_X View Post
    Any help how can I get clean array corresponding to real values ?
    If original data come from an Excel sheet so better than cleaning is creating directly
    the array without any error just using the appropriate Excel basics formula way !
    Easy to demonstrate with an explanation and an attachment, both accurate …

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,335

    Re: Re-Setting the dimension of an array to exclude #NA values

    Do I understand your request properly ?
    You want to omit from the final array any row with a (#N/A) error.
    Using an extension to your previous post see if this satisfies your requirement.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Re-Setting the dimension of an array to exclude #NA values

    Hi Torachan, Thank you for your reply.

    I can not view the code in the spreadsheet. Do you mind sending ?

    Much Appreciated !

    Najwa.

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,335

    Re: Re-Setting the dimension of an array to exclude #NA values

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-27-2013, 03:56 PM
  2. Create an array based off values in another array - exclude blanks
    By clifton1230 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2013, 05:35 PM
  3. Help!Setting Excel Htm Dimension
    By triniti in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2011, 04:20 PM
  4. Does filling part of an array from a range re-dimension the array?
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2011, 10:09 AM
  5. Write 1st and 2nd dimension array values to cells
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2006, 07:20 PM
  6. Replies: 3
    Last Post: 02-25-2006, 12:35 AM
  7. [SOLVED] Mutli-dimensional Array to Single-Dimension Array
    By Blue Aardvark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2005, 05:05 AM
  8. HOW TO ASSIGN 2 DIMENSION ARRAY VALUES FROM 2 COLUMNS?
    By -JEFF- in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1