Dim myRng as range
dim myCell as range
set myrng = sheet3.range("a2:a25000")
'or if you potentially have lots of empty cells at the bottom
with sheet3
set myrng = .range("A2", .cells(.rows.count,"A").end(xlup))
end with
for each mycell in myrng.cells
if isempty(mycell.value) then
'skip it
else
combobox1.additem mycell.value
end if
next mycell
Corey wrote:
>
> I have placed a Combobox(ActiveX) on a worksheet(Sheet2), but now i want to
> populate it will all the values(that are not blank) in Sheet3 between
> range("A2:A25000").
>
> How do i do this without manually do this:
>
> Combobox1.Additem Sheet3.Range("A2").value
> Combobox1.Additem Sheet3.Range("A3").value
> ....
> ....
> and so on?
>
> Corey....
--
Dave Peterson
|