List

J

John Lake

I am composing a list sheet of members of air cadets, age,
dob etc. I wish to add a cell to each member that when
selected would produce an editable list to add clothing
received to it. Whats the best way and how??

Would be extremely appreciative of any help.

using 2000

many thanks!!
 
J

JulieD

Hi John

not really sure what you mean about an editable list, say you have
A B C D
1 FirstName LastName DOB Clothing
2 John Smith 15/4/85

what do you specially want to see in D2?

Cheers
JulieD
 
G

Guest

-----Original Message-----
Hi John

not really sure what you mean about an editable list, say you have
A B C D
1 FirstName LastName DOB Clothing
2 John Smith 15/4/85

what do you specially want to see in D2?

Cheers
JulieD

what i was after was that when you select the clothing
cell for a person that it would show a list saying for
examples boots
2 shirts
hat
socks etc
so you know what they have been given and can add more or
remove items as they take or hand back more!!

does this help??
 
J

JulieD

Hi John

As far as i know this can not be done in excel ... you could have all of the
values separated by commas, or alt & enter (line break) but i don't think
this is really what you are looking for. Other options are a comment box
(insert / comment).

Cheers
JulieD
 
C

Casey

John,
The functionality you are looking for is part of Data validation
however, to achieve the level of "editability" you are looking for yo
are going to have to look at some VBA coding. The link below is to
web site by Debra S. Dalgleish. Almost everything I've learn abou
advanced list creation and maintenance I've learned here. It is
clear, understandable presentation of the uses of Excel's Dat
Validation list function and it's loaded with example spreadsheets.

http://www.contextures.com/xlDataVal01.html

Hope this helps,
Case
 
D

Dave Peterson

How about setting up a worksheet that looks like a little form:

First, some house keeping.

I put the "form" stuff on Sheet1.
I put the clothing list on sheet2 in A1:A???.

1 shirt
2 shirts
3 shirts
1 belt
2 belts
1 pair of pants
2 pair of pants

The output will go onto sheet3.

On sheet1, I put the name in A1 and more info in B1, C1.

Then I used the control toolbox toolbar (not the Forms toolbar) to add two
listboxes (listbox1 and listbox2).

Then I added 6 commandbuttons right between the two listboxes.

The commandbuttons are named:

BTN_moveAllLeft
BTN_moveAllRight
BTN_MoveSelectedLeft
BTN_MoveSelectedRight
btn_resetValues
btn_writetosheet

(I rightclicked on each to change the name and the caption.)

Then I rightclicked on the sheet1 tab, selected view code and pasted this in:

Option Explicit
Private Sub BTN_moveAllLeft_Click()

Dim iCtr As Long

For iCtr = 0 To Me.ListBox2.ListCount - 1
Me.ListBox1.AddItem Me.ListBox2.List(iCtr)
Next iCtr

Me.ListBox2.Clear
End Sub
Private Sub BTN_moveAllRight_Click()

Dim iCtr As Long

For iCtr = 0 To Me.ListBox1.ListCount - 1
Me.ListBox2.AddItem Me.ListBox1.List(iCtr)
Next iCtr

Me.ListBox1.Clear
End Sub
Private Sub BTN_MoveSelectedLeft_Click()

Dim iCtr As Long

For iCtr = 0 To Me.ListBox2.ListCount - 1
If Me.ListBox2.Selected(iCtr) = True Then
Me.ListBox1.AddItem Me.ListBox2.List(iCtr)
End If
Next iCtr

For iCtr = Me.ListBox2.ListCount - 1 To 0 Step -1
If Me.ListBox2.Selected(iCtr) = True Then
Me.ListBox2.RemoveItem iCtr
End If
Next iCtr

End Sub
Private Sub BTN_MoveSelectedRight_Click()

Dim iCtr As Long

For iCtr = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(iCtr) = True Then
Me.ListBox2.AddItem Me.ListBox1.List(iCtr)
End If
Next iCtr

For iCtr = Me.ListBox1.ListCount - 1 To 0 Step -1
If Me.ListBox1.Selected(iCtr) = True Then
Me.ListBox1.RemoveItem iCtr
End If
Next iCtr

End Sub

Private Sub btn_resetValues_Click()

Dim myCell As Range
Dim myRng As Range

With Worksheets("sheet2")
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
End With

Me.ListBox1.Clear
Me.ListBox2.Clear

With Me.ListBox1
.LinkedCell = ""
.ListFillRange = ""
For Each myCell In myRng.Cells
If Trim(myCell) <> "" Then
.AddItem myCell.Value
End If
Next myCell
End With

Me.ListBox1.MultiSelect = fmMultiSelectMulti
Me.ListBox2.MultiSelect = fmMultiSelectMulti

End Sub

Private Sub btn_writetosheet_Click()

Dim iCtr As Long
Dim DestCell As Range
Dim resp As Long
Dim NameCell As Range

Set NameCell = Me.Range("a1")

If Trim(NameCell.Value) = "" Then
MsgBox "Don't forget the name!"
Exit Sub
End If

If Me.ListBox2.ListCount = 0 Then
MsgBox "no clothes selected!"
Exit Sub
End If

resp = MsgBox(prompt:="are you ready to write values for: " _
& NameCell.Value, Buttons:=vbYesNo)

If resp = vbNo Then
Exit Sub
End If

With Worksheets("sheet3")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
For iCtr = 0 To Me.ListBox2.ListCount - 1
DestCell.Offset(iCtr, 0).Value = NameCell.Value
DestCell.Offset(iCtr, 1).Value = NameCell.Offset(0, 1).Value
DestCell.Offset(iCtr, 2).Value = NameCell.Offset(0, 2).Value
DestCell.Offset(iCtr, 3).Value = Me.ListBox1.List(iCtr)
Next iCtr
End With

Call btn_resetValues_Click

End Sub


If you want more "header" stuff (a1:z1), then you can play with this portion:

DestCell.Offset(iCtr, 0).Value = NameCell.Value
DestCell.Offset(iCtr, 1).Value = NameCell.Offset(0, 1).Value
DestCell.Offset(iCtr, 2).Value = NameCell.Offset(0, 2).Value
DestCell.Offset(iCtr, 3).Value = Me.ListBox1.List(iCtr)
 
D

Dave Peterson

You could even add multiple items to the list

shirt
shirt
shirt
shirt
pants
pants
pants

It won't show a quantity, but you could always count them later (a pivottable
would be nice once you have the data flattened out.)
 
Top