Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combo Box addItem question


Hi,

I am looking to populate a combox with values from a column in a
worksheet..... but not every row is populated. How do I filter out the
rows that have no values from being populated in the combo box?

Also - after my macro loads the userform - in the userform initialize
function I'd like to query a specific worksheet to pull in the values
explained above - but I'm getting an error that the object isn't
valid.

Any ideas?
Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combo Box addItem question

Private Sub Userform_Initialize()
Dim sh as Worksheet
Dim cell as Range
set sh = Worksheet("sheet1")

for each cell in sh.range(sh.cells(2,5),sh.cells(rows.count,5).End( xlup))
if not isempty(cell) then
combobox1.AddItem cell
end if
Next

End sub

--
Regards,
Tom Ogilvy

"strataguru" wrote in message
...

Hi,

I am looking to populate a combox with values from a column in a
worksheet..... but not every row is populated. How do I filter out the
rows that have no values from being populated in the combo box?

Also - after my macro loads the userform - in the userform initialize
function I'd like to query a specific worksheet to pull in the values
explained above - but I'm getting an error that the object isn't
valid.

Any ideas?
Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Real quick: AddItem with combo boxes? AVERAGE(user) New Users to Excel 3 October 29th 05 10:13 AM
additem to combobox with an array jocke Excel Discussion (Misc queries) 2 September 29th 05 07:56 PM
Help with: ListBox1.AddItem (ws.Name) Ron de Bruin Excel Worksheet Functions 0 May 18th 05 07:02 PM
Multiple Column ComboBox using Additem Jimmi Excel Programming 2 September 24th 03 02:40 AM
additem to listbox built on the fly Tom Ogilvy Excel Programming 1 July 23rd 03 04:25 PM


All times are GMT +1. The time now is 06:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"