Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

ComboBox with horizontal range on an Excel USERFORM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ca1358 - 19 Jan 2006 21:56 GMT
How do you write a source in code in VB Code for a ComboBox3 on an Excel
UserForm where the source is horizontal range.  For example Sheet2!E2:H2.
Signature

ca1358

Dave Peterson - 19 Jan 2006 22:05 GMT
dim myCell as range
dim myRng as range

set myrng = worksheets("sheet2").range("e2:h2")

With me.combobox3
for each mycell in myrng.cells
  .additem mycell.value
next mycell
end with
 

> How do you write a source in code in VB Code for a ComboBox3 on an Excel
> UserForm where the source is horizontal range.  For example Sheet2!E2:H2.
> --
> ca1358

Signature

Dave Peterson

ca1358 - 19 Jan 2006 22:25 GMT
Thank you!!!!!!!!!!!!
Signature

ca1358

> dim myCell as range
> dim myRng as range
[quoted text clipped - 12 lines]
> > --
> > ca1358
Andy Pope - 19 Jan 2006 22:24 GMT
Hi,

If it's just the contents of the cells required to populate the control
and not be linked then perhaps,

ComboBox1.List = _
    Application.WorksheetFunction.Transpose( _
    Worksheets("sheet2").Range("e2:h2"))

Cheers
Andy

> How do you write a source in code in VB Code for a ComboBox3 on an Excel
> UserForm where the source is horizontal range.  For example Sheet2!E2:H2.

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.