Results 1 to 4 of 4

Multi Dimensional Array

Threaded View

  1. #1
    Registered User
    Join Date
    11-09-2018
    Location
    USA
    MS-Off Ver
    365
    Posts
    59

    Multi Dimensional Array

    I have code with a multi dimensional array. The code searches for lines that have a certain number in a certain cell. When the array is pasted in a new worksheet, empty lines of data are kept. Is there a way for the array to skip rows that don't meet my if statement?

    Sub LM_Data()
    
    Dim arrLM()
    Dim intRows
    Dim intCols
    Dim s As Integer
    
    intRows = Cells(Rows.Count, 1).End(xlUp).Row
    intCols = 13
    
    For s = 0 To 5
    ReDim arrLM(1 To intRows, 1 To intCols)
    
       For i = 1 To UBound(arrLM, 1)
            If Cells(i, 4).Value = CStr(s) And Cells(i, 3).Value <> "0" Then
                    
                For j = 1 To UBound(arrLM, 2)
    
                arrLM(i, j) = ActiveSheet.Cells(i, j)
    
                Next j
            End If
      Next i
    Sheets(CStr(s)).Range("a1", "m" & intRows).Value = arrLM
    Next s
    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. Help converting one-dimensional array to multi-dimensional array
    By puzzlelover22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2016, 06:48 AM
  2. Set up a multi-dimensional array
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2013, 04:28 AM
  3. [SOLVED] Dim multi dimensional array
    By jdfjab in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-06-2012, 09:08 AM
  4. Declaring Multi-Dimensional Array
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2008, 08:43 AM
  5. [SOLVED] Multi Dimensional Array
    By andym in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2006, 03:29 AM
  6. [SOLVED] Multi-dimensional Array Referencing
    By Fred Kalil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2005, 09:05 AM
  7. Multi-Dimensional Array Let & Get
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 04: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