Results 1 to 18 of 18

Please help me with making a Multidimensional Array

Threaded View

learner99 Please help me with making a... 06-25-2014, 02:46 PM
PCI Re: Please help me with... 06-25-2014, 02:53 PM
Richard Buttrey Re: Please help me with... 06-25-2014, 02:58 PM
learner99 Re: Please help me with... 06-25-2014, 03:17 PM
learner99 Re: Please help me with... 06-25-2014, 03:10 PM
PCI Re: Please help me with... 06-25-2014, 03:17 PM
learner99 Re: Please help me with... 06-25-2014, 03:45 PM
PCI Re: Please help me with... 06-25-2014, 03:58 PM
learner99 Re: Please help me with... 06-25-2014, 04:32 PM
PCI Re: Please help me with... 06-25-2014, 04:45 PM
learner99 Re: Please help me with... 06-25-2014, 04:52 PM
learner99 Re: Please help me with... 06-26-2014, 05:22 PM
PCI Re: Please help me with... 06-28-2014, 02:19 PM
learner99 Re: Please help me with... 06-30-2014, 10:04 AM
PCI Re: Please help me with... 07-01-2014, 03:42 PM
learner99 Re: Please help me with... 07-02-2014, 10:02 AM
PCI Re: Please help me with... 07-02-2014, 03:34 PM
PCI Re: Please help me with... 07-03-2014, 03:17 PM
  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Please help me with making a Multidimensional Array

    Hi,
    I'm struggling to write a multidimensional array.
    Could you please help?

    Here is what I’m trying to do...

    I have an excel sheet with the following data
    Row 1 Column P 10,500
    Row 2 Column P --------
    Row 3 Column P 10,500
    Row 4 Column P 6,000
    Row 5 Column P --------
    Row 6 Column P 6,000
    Row 7 Column P 10,500

    I wrote a loop to remove dupes but it only removes a dupe if the next cell is the same as the previous cell.

    I would like it to ignore the "--------" and remove any rows that have a repeat value in any cell in column P.
    So the output would look like this
    Row 1 Column P 10,500
    Row 2 Column P --------
    Row 3 Column P 6,000
    Row 4 Column P --------

    Thank you in advance for your help.

    Sub RemoveDupes()
    '
    
    '
    Dim RowInfo() As Variant
    Dim counter As Long
    Dim r As Range
    Dim n As Long
    
        Sheets("Sheet1").Select    ' selects the sheet
        Range("P1").Select         ' select a column
        Selection.End(xlDown).Select
    
        Set r = Range("P1:" & Selection.Address)    'This is where you set the column to sort on
        
        For n = 1 To r.Rows.Count
    
            If r.Cells(n, 1) <> r.Cells(n + 1, 1) Then    '(N is the row and ,1 is the column)
                                                          'This will check the cells against each other
                ReDim Preserve RowInfo(counter)           'Make RowInfo dynamic.
                RowInfo(counter) = Mid(r.Cells(n, 1), 1, 7)
                counter = counter + 1    ' Set Index for 2nd loop
            End If
            
        Next n
        '========================================================================
        Sheets("Sheet1").Range("A1").Resize(counter) = Application.Transpose(RowInfo) ' places results on a separate spread sheet
    
    End Sub
    Last edited by learner99; 06-27-2014 at 11:16 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If statement in a Multidimensional Array Help
    By learner99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2014, 12:21 PM
  2. Using the ReDim array function in a multidimensional array in excel
    By Doruli in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2012, 01:43 PM
  3. Row copy within multidimensional array
    By guptaraja in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2010, 10:48 PM
  4. Multidimensional Array
    By sidd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2009, 09:57 PM
  5. Multidimensional array
    By gwithey in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 02-02-2009, 12:15 PM

Tags for this Thread

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