Streetsteps
New Member
- Joined
- May 17, 2022
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
Searching for a custom VBA dictionary code, for a massive workbook, containing two worksheets, sheet1 (Release) containing +40K rows, sheet 2 (Resource) containing +185k rows. I realize that any VBA macro will take a long time to execute this command–given the amount of data, that’s okay with me as long as it is functional. Any help would be greatly appreciated, I have spent months on various forums looking for a solution, and nothing quite works.
I attached images of a mock template, I created with only a few titles–to see if VBA macro is even possible to accomplish the task below. (Happy to email or DM template - if that is possible).
Ideally looking for the VBA code to focus only when the Releases worksheet Column H designated ‘Exclusive License.' [This cuts down the # of rows the macro would search by 70%].
Then isolate matches found in two cells within both worksheets, respectively Column B and C.
If an exact match, then the information in three columns of the Releases worksheet Columns H – J, is copied and replace info in the Resources worksheet of Columns H-J.
Finally, the macro should move onto the next "Exclusive License" row, repeat the command, until complete.
Latest VBA Error: Runtime Error “1004”
Sub Plzwork()
Dim Cl As Range
Dim Dic As Object
Set Dic = CreateObject("scripting.dictionary")
With Sheets("Release")
For Each Cl In .Range("$B:$C", .Range("$B:$C" & Rows.Count).End(xlUp))
Dic(Cl.Value) = Array(Cl, Cl.Offset(, 1).Value)
Next Cl
End With
With Sheets("Resources")
For Each Cl In .Range("$I:$K", .Range("$I:$K" & Rows.Count).End(xlUp))
If Dic.Exists(Cl.Value) Then
Cl.Offset(, 1).Value = Dic(Cl.Value)(1)
Dic(Cl.Value)(0).Interior.Color = vbRed
End If
Next Cl
End With
End Sub
I attached images of a mock template, I created with only a few titles–to see if VBA macro is even possible to accomplish the task below. (Happy to email or DM template - if that is possible).
Ideally looking for the VBA code to focus only when the Releases worksheet Column H designated ‘Exclusive License.' [This cuts down the # of rows the macro would search by 70%].
Then isolate matches found in two cells within both worksheets, respectively Column B and C.
If an exact match, then the information in three columns of the Releases worksheet Columns H – J, is copied and replace info in the Resources worksheet of Columns H-J.
Finally, the macro should move onto the next "Exclusive License" row, repeat the command, until complete.
Latest VBA Error: Runtime Error “1004”
Sub Plzwork()
Dim Cl As Range
Dim Dic As Object
Set Dic = CreateObject("scripting.dictionary")
With Sheets("Release")
For Each Cl In .Range("$B:$C", .Range("$B:$C" & Rows.Count).End(xlUp))
Dic(Cl.Value) = Array(Cl, Cl.Offset(, 1).Value)
Next Cl
End With
With Sheets("Resources")
For Each Cl In .Range("$I:$K", .Range("$I:$K" & Rows.Count).End(xlUp))
If Dic.Exists(Cl.Value) Then
Cl.Offset(, 1).Value = Dic(Cl.Value)(1)
Dic(Cl.Value)(0).Interior.Color = vbRed
End If
Next Cl
End With
End Sub