Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Add 2nd Column to ComboBox

Hi,
I am populating the ComboBoxes on my UserForm with the following code:


For v = 13 To 16

UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1.AddItem
Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")

Next v


I want to add a second column that is not visible to the user. The
trick is that I DO NOT want to format the 2nd column in the manner that
I am formatting the present column. And I want to make the new column
the bound column.

Any suggestions?

Your help is greatly appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Add 2nd Column to ComboBox

Justin,
You can set the columnwidth of the 2nd to 0 (or as small as possible).
You would need to set the columncount=2 and the boundcolumn to 2 also.

By the way, this would be a good situation to use a With block, to reduce
the number of objects (the number of "."s) that have to be resolved each
time.
With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
For v = 13 To 16
.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value),
"#0.000")
Next v
End With

NickHK

"Justin"
groups.com...
Hi,
I am populating the ComboBoxes on my UserForm with the following code:


For v = 13 To 16

UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1.AddItem
Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")

Next v


I want to add a second column that is not visible to the user. The
trick is that I DO NOT want to format the 2nd column in the manner that
I am formatting the present column. And I want to make the new column
the bound column.

Any suggestions?

Your help is greatly appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add 2nd Column to ComboBox

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
.Clear
.columncount = 2
.boundcolumn = 2
For v = 13 To 16


.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")
.list(.listcount-1,1) = Worksheets("Worksheet1").Cells(v, 9).Value
Next v
End with

--
Regards,
Tom Ogilvy



"Justin" wrote:

Hi,
I am populating the ComboBoxes on my UserForm with the following code:


For v = 13 To 16

UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1.AddItem
Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")

Next v


I want to add a second column that is not visible to the user. The
trick is that I DO NOT want to format the 2nd column in the manner that
I am formatting the present column. And I want to make the new column
the bound column.

Any suggestions?

Your help is greatly appreciated!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add 2nd Column to ComboBox

forgot to hide the column

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
.Clear
.columncount = 2
.boundcolumn = 2
.ColumnWidths = "-1;0"
For v = 13 To 16


.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")
.list(.listcount-1,1) = Worksheets("Worksheet1").Cells(v, 9).Value
Next v
End with

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
.Clear
.columncount = 2
.boundcolumn = 2
For v = 13 To 16


.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")
.list(.listcount-1,1) = Worksheets("Worksheet1").Cells(v, 9).Value
Next v
End with

--
Regards,
Tom Ogilvy



"Justin" wrote:

Hi,
I am populating the ComboBoxes on my UserForm with the following code:


For v = 13 To 16

UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1.AddItem
Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")

Next v


I want to add a second column that is not visible to the user. The
trick is that I DO NOT want to format the 2nd column in the manner that
I am formatting the present column. And I want to make the new column
the bound column.

Any suggestions?

Your help is greatly appreciated!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Add 2nd Column to ComboBox

Thanks that partially got the job done! I am going to post more
questions in a new topic that I can't figure out now. I really
appreciate the help guys!

Tom Ogilvy wrote:
forgot to hide the column

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
.Clear
.columncount = 2
.boundcolumn = 2
.ColumnWidths = "-1;0"
For v = 13 To 16


.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")
.list(.listcount-1,1) = Worksheets("Worksheet1").Cells(v, 9).Value
Next v
End with

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1
.Clear
.columncount = 2
.boundcolumn = 2
For v = 13 To 16


.AddItem Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")
.list(.listcount-1,1) = Worksheets("Worksheet1").Cells(v, 9).Value
Next v
End with

--
Regards,
Tom Ogilvy



"Justin" wrote:

Hi,
I am populating the ComboBoxes on my UserForm with the following code:


For v = 13 To 16

UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(0). ComboBox1.AddItem
Format((Worksheets("Worksheet1").Cells(v, 9).Value), "#0.000")

Next v


I want to add a second column that is not visible to the user. The
trick is that I DO NOT want to format the 2nd column in the manner that
I am formatting the present column. And I want to make the new column
the bound column.

Any suggestions?

Your help is greatly appreciated!





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
Multiple column Combobox JM[_8_] Excel Programming 2 January 9th 06 09:58 AM
Hiding a column in a multicolumn combobox Mike Jones Excel Programming 1 May 3rd 05 12:44 AM
Milti Column Combobox Virginia Excel Programming 1 April 23rd 05 01:58 AM
Multi Column ComboBox Steve Roberts Excel Programming 0 March 29th 05 07:17 PM
Populate Column Header on ComboBox michael_13143 Excel Programming 1 April 23rd 04 05:45 PM


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