Hi
I've got sorted list with a range name. All items in the list are grouped alphbetically. The same item can appear once or many times. I've used the find function to find the address of the first instance of the item but need to find the last as well. The Msgbox below returns $A$4. The last instance of Ziggy is in $A$10. I want the message box to return $A$4:$A$10
Sub FindValues()
Dim c As Range
Dim firstAddress As String
With Sheets("BigList").Range("Details")
Set c = Cells.Find(What:="Ziggy", LookIn:=xlFormulas, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing
End If
End With
End Sub
Actuall what I really want to do is populate a combobox with ComboBox1.List = Sheets(2).Range("A2:A10").Value
I've got sorted list with a range name. All items in the list are grouped alphbetically. The same item can appear once or many times. I've used the find function to find the address of the first instance of the item but need to find the last as well. The Msgbox below returns $A$4. The last instance of Ziggy is in $A$10. I want the message box to return $A$4:$A$10
Sub FindValues()
Dim c As Range
Dim firstAddress As String
With Sheets("BigList").Range("Details")
Set c = Cells.Find(What:="Ziggy", LookIn:=xlFormulas, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing
End If
End With
End Sub
Actuall what I really want to do is populate a combobox with ComboBox1.List = Sheets(2).Range("A2:A10").Value