Results 1 to 7 of 7

Thread: Improving Speed Comparing Multiple Columns

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    It would have been nice if you had described what the code should do under what conditions...

    Code:
    Sub M_snb()
        sn = Sheets("Current").Cells(1).CurrentRegion.Offset(, 5).Resize(, 15)
        sp = Sheets("Previous").Cells(1).CurrentRegion.Offset(, 5).Resize(, 15)
    
         With CreateObject("scripting.dictionary")
            For j = 1 To UBound(sn)
              .Item(sn(j, 1)) = Application.Index(sn, j, 0)
            Next
    
            For j = 1 To UBound(sp)
                 st = .Item(sp(j, 1))
                 st(13) = sp(j, 5)
                 st(14) = sp(j, 6)
                 st(15) = sp(j, 7)
                 .Item(sp(j, 1)) = Application.Index(st)
            Next
        
            Sheets("CURRENT").Cells(1).CurrentRegion.Offset(, 5).Resize(, 15) = Application.Index(.items, 0, 0)
        End With
    End Sub
    Last edited by snb; 10-01-2013 at 06:29 PM.

  2. #2
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0
    Thanks for replying snb. I'm trying to identify date and timeframe changes from one report to the next. I tried your code and got a compile error - "array is expected" on this piece of code.

    Code:
    For j = 1 To UBound(sn)

Similar Threads

  1. Concatenate Two Or Multiple Columns In To One
    By william516 in forum Excel Help
    Replies: 10
    Last Post: 07-06-2013, 12:09 AM
  2. Replies: 7
    Last Post: 05-15-2013, 02:56 PM
  3. Replies: 4
    Last Post: 04-05-2013, 12:08 PM
  4. Replies: 2
    Last Post: 06-14-2012, 04:10 AM
  5. Speed up Loop VBA
    By PcMax in forum Excel Help
    Replies: 15
    Last Post: 04-09-2012, 04:20 PM

Posting Permissions

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