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

Thank You M. Ogilvy for your answer but...

Private Sub Userform_Initialize()
For i = 1 To 6
ComboBox1.AddItem Worksheets("sheet1").Cells(1, i)
Next
End Sub

Your Example return only the value on my cells A1, B2, etc,
I would like appeared
Column A
Column B
Column C
in my ComboBox1
as the UserForm from "Data - Sort... - of Excel

Could I help me?

Thank you very much,

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

Private Sub Userform_Initialize()
for i = 1 to 6
if isnumeric(Worksheets("Sheet1").Cells(1,i)) then
combobox1.AddItem "Column " & char(64+i)
End if
Next
end sub

--
regards,
Tom Ogilvy


"Michel" wrote in message
m...
Thank You M. Ogilvy for your answer but...

Private Sub Userform_Initialize()
For i = 1 To 6
ComboBox1.AddItem Worksheets("sheet1").Cells(1, i)
Next
End Sub

Your Example return only the value on my cells A1, B2, etc,
I would like appeared
Column A
Column B
Column C
in my ComboBox1
as the UserForm from "Data - Sort... - of Excel

Could I help me?

Thank you very much,

Michel



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

Just a guess, but I'm betting you made a typo in your code (and copied the
correct version in your post).

You posted this:
ComboBox1.AddItem Worksheets("sheet1").Cells(1, i)

But I bet you have this in your code:
ComboBox1.AddItem Worksheets("sheet1").Cells(i, i)



Michel wrote:

Thank You M. Ogilvy for your answer but...

Private Sub Userform_Initialize()
For i = 1 To 6
ComboBox1.AddItem Worksheets("sheet1").Cells(1, i)
Next
End Sub

Your Example return only the value on my cells A1, B2, etc,
I would like appeared
Column A
Column B
Column C
in my ComboBox1
as the UserForm from "Data - Sort... - of Excel

Could I help me?

Thank you very much,

Michel


--

Dave Peterson

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

Ohhhhhhh. I get it.

Tom Ogilvy wrote:

Private Sub Userform_Initialize()
for i = 1 to 6
if isnumeric(Worksheets("Sheet1").Cells(1,i)) then
combobox1.AddItem "Column " & char(64+i)
End if
Next
end sub

--
regards,
Tom Ogilvy

"Michel" wrote in message
m...
Thank You M. Ogilvy for your answer but...

Private Sub Userform_Initialize()
For i = 1 To 6
ComboBox1.AddItem Worksheets("sheet1").Cells(1, i)
Next
End Sub

Your Example return only the value on my cells A1, B2, etc,
I would like appeared
Column A
Column B
Column C
in my ComboBox1
as the UserForm from "Data - Sort... - of Excel

Could I help me?

Thank you very much,

Michel


--

Dave Peterson

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
Trouble with a ComboBox on a UserForm ryguy7272 Excel Discussion (Misc queries) 1 February 20th 08 09:02 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM
ComboBox on UserForm Michel[_4_] Excel Programming 2 July 31st 04 10:11 PM


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