Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Listbox with text & input row


Is it possible to create a listbox that has text (description) and an
input (number) in the same row?

Shirts X
Shoes X
Pants X

This way I can list the items, scroll to the item and input a number
("X").

Thanks!


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=533816

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Listbox with text & input row

You can only do that on a userform listbox and not through the forms
toolbar. Here is some code that should help you out:

Private Sub UserForm_Initialize()
Dim strArray As Variant

strArray = Array("Shirt", "Pants", "Shorts", "Sweater", "Socks")
With Me.ListBox1
.ColumnCount = 2
.ColumnHeads = False
For i = 1 To 5
.AddItem i
.List(.ListCount - 1, 1) = strArray(i - 1)
Next i
.ColumnWidths = "20;50"
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Listbox with text & input row


Thanks. That was close and helps me better understand how I can
populate a listbox. I can see I wasn't explaining myself as well as I
may have...

What I'm looking for is to be able to display text ("Shirts", "Shoes",
"Pants") and allow input (allow me to click and type in a number) in a
single row in a list box. Similarily the list...

Shirts 0
Shoes 0
Pants 0

would allow me to click on the zero next to "Shirts" and type in the
number 10. Then click on the zero next to "Pants" and type in the
number 5.

resulting in...

Shirts 10
Shoes 0
Pants 5

So the first column is a text field and the second column is an input
(Numeric) field.

Is this possible?


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=533816

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Listbox with text & input row

You can't do this through a list box, as a list box only allows you to
list things and then select one or many. The only object that lets you
type in a value is the text box. You could use a number of labels and
line them up with text boxes, and then enter the value of the label to
be "shirt", "pants", etc. Can I ask why you are trying to do this
through objects versus just having a few cells in a worksheet where you
list "shirt", "pants", etc and then have the cells next to them be
where you enter the quantity?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Listbox with text & input row


I figured the listbox was just for listing stuff...

I need to do this in a form and have LOTS of items, which may vary,
that I need to display. I found some code where I can click on the
listbox item, then display the item name and default value (using
InputBox), allow the value to be changed, the plunk it back in the
correct column when the InputBox is dismissed with the OK button.
Serves the purpose.

Thanks for your help & responses.


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=533816



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
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Form Input, with (listbox) review then copy to worksheet Sami82[_6_] Excel Programming 1 October 3rd 05 10:13 AM
How do i input data into a 2nd column in a listbox? Devitt Excel Programming 3 September 16th 04 02:12 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Validating user input to a listbox Stuart[_5_] Excel Programming 3 September 6th 03 07:32 AM


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