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

Hey all,

I current have a ComboBox on a UserForm with 2 columns. The first
column displays formatted values, and the second invisible column
contains key unformatted numbers from the same list that are bound to
the spreadsheet and change the spreadsheet cell when an item on the
list changes.

I am using this code below to populate my column lists:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
End With

MY PROBLEM: Right now - it is erasing data in the spreadsheet cell, and
I don't know how to populate the ComboBox Column 1 with what was last
selected in the ComboBox list. Right now it's blank... Any suggestions
on how to implement a solution into the code I'm using above?

Thanks!!!

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

Addendum: I meant that the ComboBox.Value is blank - the lists show up
perfectly...

Justin wrote:
Hey all,

I current have a ComboBox on a UserForm with 2 columns. The first
column displays formatted values, and the second invisible column
contains key unformatted numbers from the same list that are bound to
the spreadsheet and change the spreadsheet cell when an item on the
list changes.

I am using this code below to populate my column lists:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
End With

MY PROBLEM: Right now - it is erasing data in the spreadsheet cell, and
I don't know how to populate the ComboBox Column 1 with what was last
selected in the ComboBox list. Right now it's blank... Any suggestions
on how to implement a solution into the code I'm using above?

Thanks!!!


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

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
v = .Value
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
.Value = v
End With

--
Regards,
Tom Ogilvy


"Justin" wrote:

Addendum: I meant that the ComboBox.Value is blank - the lists show up
perfectly...

Justin wrote:
Hey all,

I current have a ComboBox on a UserForm with 2 columns. The first
column displays formatted values, and the second invisible column
contains key unformatted numbers from the same list that are bound to
the spreadsheet and change the spreadsheet cell when an item on the
list changes.

I am using this code below to populate my column lists:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
End With

MY PROBLEM: Right now - it is erasing data in the spreadsheet cell, and
I don't know how to populate the ComboBox Column 1 with what was last
selected in the ComboBox list. Right now it's blank... Any suggestions
on how to implement a solution into the code I'm using above?

Thanks!!!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 2-Column ComboBox Issues

Thanks Tom! I just tried that and it's still blank and clearing out the
cell in the spreadsheet. Maybe I am defining the wrong column?

Tom Ogilvy wrote:
With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
v = .Value
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
.Value = v
End With

--
Regards,
Tom Ogilvy


"Justin" wrote:

Addendum: I meant that the ComboBox.Value is blank - the lists show up
perfectly...

Justin wrote:
Hey all,

I current have a ComboBox on a UserForm with 2 columns. The first
column displays formatted values, and the second invisible column
contains key unformatted numbers from the same list that are bound to
the spreadsheet and change the spreadsheet cell when an item on the
list changes.

I am using this code below to populate my column lists:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
End With

MY PROBLEM: Right now - it is erasing data in the spreadsheet cell, and
I don't know how to populate the ComboBox Column 1 with what was last
selected in the ComboBox list. Right now it's blank... Any suggestions
on how to implement a solution into the code I'm using above?

Thanks!!!




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 2-Column ComboBox Issues

I was a guess. There is nothing in the code shown that writes to the
worksheet.

I figured you might have it linked to a cell and when you rebuilt the list,
it cleared the selection and cleared the cell (and or triggers the change
event)

--
Regards,
Tom Ogilvy


"Justin" wrote:

Thanks Tom! I just tried that and it's still blank and clearing out the
cell in the spreadsheet. Maybe I am defining the wrong column?

Tom Ogilvy wrote:
With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
v = .Value
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
.Value = v
End With

--
Regards,
Tom Ogilvy


"Justin" wrote:

Addendum: I meant that the ComboBox.Value is blank - the lists show up
perfectly...

Justin wrote:
Hey all,

I current have a ComboBox on a UserForm with 2 columns. The first
column displays formatted values, and the second invisible column
contains key unformatted numbers from the same list that are bound to
the spreadsheet and change the spreadsheet cell when an item on the
list changes.

I am using this code below to populate my column lists:

With UserForm1.MultiPage1.Pages(0).MultiPage2.Pages(1). ComboBox1
.ColumnCount = 2
.BoundColumn = 2
.ColumnWidths = "-1;0"

For j = 12 To 23
.AddItem
Format((Worksheets("Worksheet1").Cells(j, 11).Value), "#0.000")
.List(.ListCount - 1, 1) =
Worksheets("Worksheet1").Cells(j, 11).Value
Next j
End With

MY PROBLEM: Right now - it is erasing data in the spreadsheet cell, and
I don't know how to populate the ComboBox Column 1 with what was last
selected in the ComboBox list. Right now it's blank... Any suggestions
on how to implement a solution into the code I'm using above?

Thanks!!!






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
Pastying From web issues: 1 column Jason W New Users to Excel 3 August 9th 08 07:03 PM
Add 2nd Column to ComboBox Justin[_14_] Excel Programming 4 September 14th 06 06:34 PM
ComboBox List Formatting Issues in European Regions Drummer361 Excel Programming 2 August 7th 06 05:58 PM
multi-column listbox on userform, multiple issues KR Excel Programming 2 February 15th 06 07:55 PM
ComboBox Issues Darrin Henshaw Excel Programming 1 April 16th 05 01:35 PM


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