Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ComboBox with horizontal range on an Excel USERFORM

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ComboBox with horizontal range on an Excel USERFORM

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


ca1358 wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ComboBox with horizontal range on an Excel USERFORM

Thank you!!!!!!!!!!!!
--
ca1358


"Dave Peterson" wrote:

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


ca1358 wrote:

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


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default ComboBox with horizontal range on an Excel USERFORM

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

ca1358 wrote:
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.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
Horizontal Input for Combobox krais Excel Discussion (Misc queries) 2 July 5th 06 07:37 PM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM
ComboBox on UserForm Michel[_4_] Excel Programming 3 August 1st 04 11:10 PM
ComboBox RowSource --- can I use a userform OWC10 spreadsheet range? Dean Frazier Excel Programming 0 February 11th 04 07:16 PM


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

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

About Us

"It's about Microsoft Excel"