PcMax
01-06-2012, 11:02 PM
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
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
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
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