Updating large data

eedrah

New Member
Joined
Sep 26, 2018
Messages
12
Our company have a large excel list (about 100 000 rows and 20 columns) we need to maintain. We receive updates from a third party every month (for some of the fields only) and need some way to check, for each entry, if there has been an update. I have made a simple macro for this in excel that will check one entry at a time: It works, but it takes days to loop through it all. Does anyone have a better solution - in excel or any other program?

Typically, our existing sheet will have columns like:
Unique ID - Vessel ID - Vessel name - Vessel type - Owner - Product delivered etc

The update we receive will contain:
Vessel ID - Vessel name - Vessel type - Owner

I can relate the two sheets using Vessel ID, but only some of the fields will be updated every month.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
On the register sheet, which is the first & last column to be updated?
So Col N has the value to be checked, will there be any columns before that, that need changing & what is the last column to be changed.
 
Upvote 0
On the register sheet, which is the first & last column to be updated?
So Col N has the value to be checked, will there be any columns before that, that need changing & what is the last column to be changed.

There are several ones on the register sheet that will be updated, and they are not adjacent. I will try to go through all tomorrow. Perhaps I can just remove the ones that do not need updating, and add them back when I am done. Any way to run this without changing format to text, you think?
 
Upvote 0
Can you please answer my question?
 
Upvote 0
Double checked, and M will have the value to be checked, N will be the first column updated and FU the last one.
 
Upvote 0
Thanks for that.
Try this to see if you still get the out of memory warning.
Code:
Sub chk()
   Dim Ary As Variant
   
   Ary = Range("M1", Range("FU" & Rows.Count).End(xlUp)).Value
End Sub
 
Upvote 0
Ok, try this
Code:
Sub UpdateFile()
   Dim Cl As Range
   Dim Uws As Worksheet, Rws As Worksheet
   Dim Ary As Variant
   Dim i As Long
   
   Set Uws = Sheets("Update")
   Set Rws = Sheets("Register")
   Ary = Rws.Range("M1", Rws.Range("FU" & Rows.Count).End(xlUp)).value2
   With CreateObject("scripting.dictionary")
      For Each Cl In Uws.Range("A2", Uws.Range("A" & Rows.Count).End(xlUp))
         .Item(Cl.Value) = Application.Index(Cl.Offset(, 1).Resize(, 10).Value, 1, 0)
      Next Cl
      For i = 2 To UBound(Ary)
         If .exists(Ary(i, 1)) Then
            Ary(i, 2) = .Item(Ary(i, 1))(4)
            Ary(i, 3) = .Item(Ary(i, 1))(6)
         End If
      Next i
   End With
   Rws.UsedRange.Clear
   Rws.Range("M1").Resize(UBound(Ary), UBound(Ary, 2)).Value = Ary
End Sub
This will update Cols N & O
 
Upvote 0
It doesn't seem to work. Only thing that happens is that everything disappears except the Register headings in columns M:FU
 
Upvote 0
Ok,how about
Code:
Sub UpdateFile()
   Dim Cl As Range
   Dim Uws As Worksheet, Rws As Worksheet
   Dim Ary As Variant
   Dim i As Long, Lr As Long
   
   Set Uws = Sheets("Update")
   Set Rws = Sheets("Pcode")
   Lr = Rws.Range("M" & Rows.Count).End(xlUp).Row
   Ary = Rws.Range("M1:FU" & Lr).value2
   With CreateObject("scripting.dictionary")
      For Each Cl In Uws.Range("A2", Uws.Range("A" & Rows.Count).End(xlUp))
         .Item(Cl.Value) = Application.Index(Cl.Offset(, 1).Resize(, 10).Value, 1, 0)
      Next Cl
      For i = 2 To UBound(Ary)
         If .exists(Ary(i, 1)) Then
            Ary(i, 2) = .Item(Ary(i, 1))(4)
            Ary(i, 3) = .Item(Ary(i, 1))(6)
         End If
      Next i
   End With
   Rws.Range("M:FU").EntireColumn.Clear
   Rws.Range("M1").Resize(UBound(Ary), UBound(Ary, 2)).Value = Ary
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top