PC Review


Reply
Thread Tools Rate Thread

Combobox add large range of cells

 
 
Corey
Guest
Posts: n/a
 
      17th Nov 2009
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....


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      17th Nov 2009
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
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox for a range of cells Malka Microsoft Excel Misc 2 16th Feb 2010 09:04 PM
ComboBox AddItem code to reference cells in a Range HBC_MT Microsoft Excel Misc 0 26th Feb 2009 04:05 PM
Populate Cells With Range Via ComboBox BJ Microsoft Excel Programming 4 4th Aug 2008 09:24 PM
Selecting a large range of cells? FISH Microsoft Excel Discussion 4 11th Apr 2008 07:39 AM
Combobox to determine text for a range of cells =?Utf-8?B?Um9iYnlu?= Microsoft Excel Programming 0 26th Jun 2006 03:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:39 AM.