Tim Hanson
Member
Dose anyone have a faster way to do this Match two columns.
I have a project with a file that is about 110,000 rows and might grow to 250,000 rows and this macro is vary slow to run
Also I have never worked with files over say 10,000 rows is there anything I need be aware off for larger files?, dose code that works on smaller files always work on larger files (maybe this is a silly question but I ask it anyway)
Thanks for any help
I have a project with a file that is about 110,000 rows and might grow to 250,000 rows and this macro is vary slow to run
Also I have never worked with files over say 10,000 rows is there anything I need be aware off for larger files?, dose code that works on smaller files always work on larger files (maybe this is a silly question but I ask it anyway)
Thanks for any help
Code:
Sub MatchPermissionGiverAndTarget()
Dim LastRow As Long
Dim ws As Excel.Worksheet
GoFast False
Set ws = ActiveWorkbook.Sheets("Helper")
LastRow = ws.Range("A" & ws.Rows.count).End(xlUp).Row
Range("E1").EntireColumn.Insert
Range("E1").FormulaR1C1 = "name"
With ws.Range("E2:E" & LastRow)
.Formula = "=INDEX(B:B,MATCH($D2,$B:$B,0))"
.Value = .Value
End With
Columns("D:D").EntireColumn.Delete
GoFast True
End Sub
Code:
Sub GoFast(Optional Reset As Boolean = False)
' Set various application properties.
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
End Sub