Good day
I try to get an unique list to use it on dropdown list but the below code give me an error
I try to get an unique list to use it on dropdown list but the below code give me an error
VBA Code:
Sub CopyUniqueValues()
Dim lastRow As Long
Dim uniqueValues As Variant
Dim i As Long
Sheets("histor").Select
' Find the last row in column C of histor
lastRow = Sheets("histor").Cells(Rows.Count, "k").End(xlUp).Row
' Get the unique values from column C of Sheet1
uniqueValues = WorksheetFunction.Unique(Sheets("histor").Range("k1:k100"))
' Paste the unique values into cell D4 of Sheet2
For i = 1 To UBound(uniqueValues)
Sheets("DAILY OPS REPORT8").Range("IB4").Offset(i - 1, 0).Value = uniqueValues(i, 1)
Next i
End Sub