I have a combo box that I added to a sheet and All I'm trying to do is clear it (empty it) before I add to it so I don't get duplicate data. There must be an easy way to do this because the way I'm doing it seems a bit verbose.
Here is my code any thoughts?
Option Explicit
Sub ClearMe()
Dim r As Long
With Sheet1.cbpartnumber
.ListFillRange = Range("AZ1").Address
End With
On Error Resume Next
Do While Sheet1.cbdestination.ListCount <> 0
For r = 0 To Sheet1.cbdestination.ListCount
With Sheet1.cbdestination
.RemoveItem (r)
End With
Next r
Loop
End Sub
Thanks, Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm a frayed knot.
Here is my code any thoughts?
Option Explicit
Sub ClearMe()
Dim r As Long
With Sheet1.cbpartnumber
.ListFillRange = Range("AZ1").Address
End With
On Error Resume Next
Do While Sheet1.cbdestination.ListCount <> 0
For r = 0 To Sheet1.cbdestination.ListCount
With Sheet1.cbdestination
.RemoveItem (r)
End With
Next r
Loop
End Sub
Thanks, Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm a frayed knot.