Hi Everyone,
Please note I have been using a VBA code to find small codes (between 8 and 25 characters) in order to find them and paint them in a specific color.
But I have a situation I had to concatenate some cells and now my code to find can have more than 70 characters as one value, vba code is taking the whole life to do it.
Does anybody knows a code that can find large values fast ? In a table with more than 50 thousand lines and more than 50 columns populated. Usually I need to find 300 values into the big table (50.000 records)
Example:
Reference: I was trying to do the same code but the thing is the value to find is triple larger and it takes a lot of time
Appreciate your help
Please note I have been using a VBA code to find small codes (between 8 and 25 characters) in order to find them and paint them in a specific color.
But I have a situation I had to concatenate some cells and now my code to find can have more than 70 characters as one value, vba code is taking the whole life to do it.
Does anybody knows a code that can find large values fast ? In a table with more than 50 thousand lines and more than 50 columns populated. Usually I need to find 300 values into the big table (50.000 records)
Example:
12GALAllAllAllAllDISCARDS CCAllAllAllAllAllAllAllAllAll999912 |
Reference: I was trying to do the same code but the thing is the value to find is triple larger and it takes a lot of time
VBA Code:
Sub ADDSCRA()
Application.ScreenUpdating = False
Sheets("Master Hierarchy").Select
'Logica de buscar duplicados
Columns("E:E").Select
Application.CutCopyMode = False
Selection.NumberFormat = "@"
Dim W As Integer
Dim ID
Dim X
Dim i As Integer
Dim Last_row As Long
Last_row = Cells(Rows.Count, 1).End(xlUp).Row + 1
For i = 2 To Last_row
On Error Resume Next
If Sheets("Master Hierarchy").Range("A" & i).Value = "ADD" Then
Application.Wait (Now + TimeValue("0:00:01") / 10)
W = i
ID = Sheets("Master Hierarchy").Range("E" & W).Value
X = Empty
X = Worksheets("System").Columns(3).Find((ID), LookIn:=xlValues, LookAt:=xlWhole).Row
If X <> Empty Then
If Sheets("Master Hierarchy").Range("E" & W).Value = Sheets("System").Range("C" & X).Value Then
Sheets("Master Hierarchy").Select
Range("E" & W).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
End If
End If
Next i
End Sub
Appreciate your help