I want a user to ctrl-click cells on one worksheet, and from that selection I will find corresponding information on another worksheet.
I know how to set the range to what has been selected and I know how to get the count of what is selected. But what I don't know is how to go through those selected items individually so that I can get the information I ultimately want to get.
So I found this code. However, as it goes through the loop, it simply goes to the cell directly below it and not the next cell in the selected range.
How do I identify the specific cells within the selected range?
Btw, the code between the IF and Else is not what I want; it's just something that was included in the original code.
I know how to set the range to what has been selected and I know how to get the count of what is selected. But what I don't know is how to go through those selected items individually so that I can get the information I ultimately want to get.
So I found this code. However, as it goes through the loop, it simply goes to the cell directly below it and not the next cell in the selected range.
How do I identify the specific cells within the selected range?
Btw, the code between the IF and Else is not what I want; it's just something that was included in the original code.
Code:
Sub DistroList()
Dim Distro As String
Dim pmSelect As Integer
Dim i As Integer
areaCount = Selection.Areas.Count
If areaCount <= 1 Then
MsgBox "The selection contains " & _
Selection.Rows.Count & " rows."
Else
i = 1
For Each a In Selection.Areas
MsgBox Cells(i, 4).Value
i = i + 1
Next a
End If
End Sub