Generate A List of Unique Values / Unique Array
Hi,
I would like to get a unique list and if you ordered the following code to obtain the individual columns in a multiple selection
What should I make changes to the code
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim tArr() As Variant
ReDim tArr(0)
For Each celle In Target
i = i + 1
tArr(UBound(tArr)) = celle.Column
ReDim Preserve tArr(UBound(tArr) + 1)
Next
ReDim Preserve tArr(UBound(tArr) - 1) '???
For Each COLONNA In tArr()
MsgBox COLONNA
Next
End Sub