Results 1 to 19 of 19

Help! Resize Array by Looping through incrementer

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    114

    Help! Resize Array by Looping through incrementer

    Below is the code. It errors out on this line: ReDim Preserve nuArr(1 To c, 1 To 1) "Type mismatch"

    Any help/comments will be much appreciated!

    Sub vArr()
    Dim Arr1 As Variant
    Dim nuArr As Variant
    
    Arr1 = Sheet1.Range("A1:A10")
    
    For i = 1 To UBound(Arr1)
        If Arr1(i, 1) > 5 Then
        c = c + 1
        ReDim Preserve nuArr(1 To c, 1 To 1)  ' Trying to resize Array
        nuArr(c, 1) = Arr1(i, 1)
        End If
    Next
    
    Sheet1.Cells(1, 2).Resize(UBound(nuArr)) = nuArr
        
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to resize PI datalink array??
    By scooter2012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2013, 07:13 PM
  2. [SOLVED] Quick Array question - Copy array to another array then resize?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-02-2013, 01:17 AM
  3. Replies: 4
    Last Post: 02-21-2013, 05:35 PM
  4. [SOLVED] Read last element of Split array and then discard it and resize the array.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 06:36 PM
  5. Array and resize
    By CoRrRan in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-08-2005, 11:05 AM

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