+ Reply to Thread
Results 1 to 3 of 3

how add dictionary and and array to my code to make a quick

  1. #1
    Forum Contributor
    Join Date
    01-08-2021
    Location
    MISU
    MS-Off Ver
    2016
    Posts
    138

    how add dictionary and and array to my code to make a quick

    hello
    I got this code from the internet to merge and summing duplicated value when summing the duplicated values should see to COL A,B,C together and put the result start COL g my code is very slow and just see to COL A so I want Use dictionary and array to make it fast especially my data are increasable
    HTML Code: 
    Sub RunMe()
    Dim mFind As Range
    
    Columns("A:C").Copy Columns("G:I")
    Columns("G:I").RemoveDuplicates Columns:=(1), Header:=xlYes
    Columns("J").Delete
    Range("J1") = "Total"
    
    For Each cell In Range("G2:G" & Range("G1").End(xlDown).Row)
        Set mFind = Columns("A:A").Find(what:=cell.Value, lookat:=xlWhole)
        fAddress = mFind.Address
        Do
            cell.Offset(0, 3) = cell.Offset(0, 3) + mFind.Offset(0, 3)
            Set mFind = Columns("A:A").FindNext(mFind)
        Loop While mFind.Address <> fAddress
    Next cell
    MsgBox "Summed!"
    End Sub
    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    18,487

    Re: how add dictionary and and array to my code to make a quick

    Your current code is only summing the duplicate of Col.A, not Col.A, B & C altogether.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-08-2021
    Location
    MISU
    MS-Off Ver
    2016
    Posts
    138

    Re: how add dictionary and and array to my code to make a quick

    it's very great thanks so much that what I want

+ 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. [SOLVED] Quick Question: Any way to make following Code simpler?
    By joelmoor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2019, 06:14 AM
  2. is Possible to make Array dictionary or multiple dicitionary
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2018, 02:00 PM
  3. Help to adjust code for nested dictionary to array
    By max138 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2017, 05:40 AM
  4. Cant get data to populate in VBA code from array & scripting dictionary
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2015, 04:38 AM
  5. help assigning elements of dictionary to array and then pasting array into worksheet
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-05-2013, 10:37 AM
  6. [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
  7. make an array of objects, by code?
    By mjcordeiro in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-04-2010, 04:18 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