Hi,
I have a column with numeric data and a function of a search for unique data would assign the position.
The code should work with 200,000 rows and 20,000 different values (all listed)
Unique list:
123.20
11.40
34.00
12.10
Column G
123.20
11.40
123.20
34.00
11.40
12.10
---------------
Unique list:
123.20 |1
11.40 |2
123.20 |1
34.00 |3
11.40 |2
12.10 |4
I attach an example to improve.
Code:Sub Add_Value() Dim row As Long, descr As String Application.ScreenUpdating = False row = 2 Do While Cells(row, "G").Value <> "" Select Case Cells(row, "G").Value Case 123.20: descr = 1 Case 11.40: descr = 2 Case 34.00: descr = 3 Case 12.10: descr = 4 'Ecc... ' Case Else: descr = "" End Select Cells(row, "H").Value = descr row = row + 1 Loop Application.ScreenUpdating = True End Sub




Reply With Quote

Bookmarks