Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ComboBox on UserForm

Hi,

In my UserForm, I have a ComboBox and if in my sheet, sheet1, in my
cells A1 until F1, I have a number, I want to see appeared in my
comboBox:
Column A
Column B
....
Column F

Is it possible?

Thank you

Michel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default ComboBox on UserForm


In my UserForm, I have a ComboBox and if in my sheet, sheet1, in my
cells A1 until F1, I have a number, I want to see appeared in my
comboBox:
Column A
Column B
...
Column F

Is it possible?


Yes. Put the following code with the UserForm. Change sheet name
if needed.

Private Sub UserForm_Activate()
Dim iCt As Integer
For iCt = 1 To 6
vData = Sheets("Sheet1").Cells(1, iCt)
If Application.IsNumber(vData) = True Then _
ComboBox1.AddItem vData
Next iCt
End Sub

HTH,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ComboBox on UserForm

Using additem. You can't bind the data to the combobox using rowsource.

Private Sub Userform_Initialize()
for i = 1 to 6
combobox1.AddItem Worksheets("sheet1").Cells(1,i)
Next
end sub

or
Private Sub Userform_Initialize()
combobox1.List = Application.Transpose( _
Worksheets("sheet1").Range("A1:F1").Value)
End sub


--
Regards,
Tom Ogilvy

"Michel" wrote in message
om...
Hi,

In my UserForm, I have a ComboBox and if in my sheet, sheet1, in my
cells A1 until F1, I have a number, I want to see appeared in my
comboBox:
Column A
Column B
...
Column F

Is it possible?

Thank you

Michel



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
Value From ComboBox On UserForm jlclyde Excel Discussion (Misc queries) 3 October 16th 09 01:43 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
Trouble with a ComboBox on a UserForm ryguy7272 Excel Worksheet Functions 1 February 19th 08 07:41 AM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM
Userform ComboBox and TextBox help!!! Pete Excel Programming 1 February 13th 04 09:13 PM


All times are GMT +1. The time now is 03:35 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"