Data validation

ehsas69

Board Regular
Joined
Jan 10, 2004
Messages
221
I have following names in my excel file

Mali
Honam
Fanmoon
Bassam
Ramzi
Tokenam

I have created validation list but I only can select one name.How can I select more than one name.

For example I would like to have drop down wit selecting names as follow
Mali & Bassam
Ramzi & Fanmoon & Honam
Etc
Kindly help
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
PM me with your e-mail address and I will gladly send you a small demo file;

Jim May
 
Upvote 0
From the developer tab select Insert.

Mouse over the Forms controls until you see the tool tip for listbox (it looks like a box with lines in it and small up and down arrows on the right side).

Click that once and then click where ever you want to place it on your worksheet.

Right click on the control and select "Format Control"

In the resulting dialog box, switch to the Control tab.

From there choose the "Multi" radio button. You can also set the input range (that would be the range of cells that house you names) there as well.
 
Upvote 0
Well you can't. You can just select and un-select them. You may want to give Jim's solution a try:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then GoTo errHandler
Set Rng = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo errHandler
If Not Intersect(Target, Rng) Is Nothing Then
Application.EnableEvents = False
newval = Target.Value
Application.Undo
oldval = Target.Value
Target.Value = newval
    If Target.Column = 1 Then
        If oldval = "" Then
        'do nothing
        Else
        If newval = "" Then
        'do nothing
        Else
        Target.Value = oldval & ", " & newval
        End If
        End If
    End If
End If
'Application.EnableEvents = True;since errHandler only includes App.EnableEvents = True
'Exit Sub                   program jumps over errHandler: and performs App.EnableEvents = True
errHandler:
Application.EnableEvents = True
End Sub

The above code assumes your data validation is in the first column. Edit this line:
Code:
If Target.Column = 1 Then

to be whatever your data validation is (column A =1, column B = 2, column C =3, etc, etc, etc).

Hopefully he'll be available to help should you need anything (you can Private Message him for a small demo file)
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top