Data Validation - Two Entries in One Cell

SimonHughes

Well-known Member
Joined
Sep 16, 2009
Messages
507
Office Version
  1. 365
Platform
  1. Windows
Hello, I have a worksheet to schedule engineers visits to customer premises. Engineers names in the Row 1, dates in Column A. Sometimes an engineer will go to two or three customers on the same day and I need to show that in the single cell.
I am using data validation to pick from a customer list and by using the ALT+Enter function I can add a second customer in the cell with free text (which defeats the object of uniformity). I have changed the "Stop" to "Information" so it does work OK but I would like to know if I can have more than a single entry via data validation in one cell? Example of what I want is below.

TIA>

DateEngineer 1
Sun 01 Sep 2024
Mon 02 Sep 2024
Tue 03 Sep 2024Lorenzo Street
Wed 04 Sep 2024
Thu 05 Sep 2024
Fri 06 Sep 2024BB Belfast (Cathedral Quarter) Westin Another
Sat 07 Sep 2024
Sun 08 Sep 2024
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Here is a link to a step-by-step guide to create a multi-entry Data Validation dropdown.
Excel Data Validation - Select Multiple Items

Alternatively, consider putting the additional locations in adjacent columns or have multiple rows with the same date for each additional location. This would give you more flexibility if you wanted to summarize the data in the future e.g. count how many times you visited a location within a given date range..
 
Upvote 0
Here is a link to a step-by-step guide to create a multi-entry Data Validation dropdown.
Excel Data Validation - Select Multiple Items

Alternatively, consider putting the additional locations in adjacent columns or have multiple rows with the same date for each additional location. This would give you more flexibility if you wanted to summarize the data in the future e.g. count how many times you visited a location within a given date range..
That was a consideration but with 14 engineers who could all visit multiple sites on the same day we could have 10, 20 or 30 rows for a single date which would be a bit too unwieldy.
 
Upvote 0
Worksheet event is used.
Validation Range H2:H10. Validation list range K2:K8. Do the validation. Keep the 'Information' as it is.
Then use worksheet event.
Code
VBA Code:
Dim S As String

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If S <> "" Then Target = S & Chr(10) & Target
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("H2:H10")) Is Nothing Then
S = Target
End If
End Sub
How to use worksheet event the code
Right click on Sheet tab --> view code
Visual Basic (VB) window opens.
Paste the code
Close the VB window.
Save the file as .xlsm
 
Upvote 0
Worksheet event is used.
Validation Range H2:H10. Validation list range K2:K8. Do the validation. Keep the 'Information' as it is.
Then use worksheet event.
Code
VBA Code:
Dim S As String

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If S <> "" Then Target = S & Chr(10) & Target
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("H2:H10")) Is Nothing Then
S = Target
End If
End Sub
How to use worksheet event the code
Right click on Sheet tab --> view code
Visual Basic (VB) window opens.
Paste the code
Close the VB window.
Save the file as .xlsm
Hi, I have followed these steps, and thanks you, but there is no effect at all? The full range of the sheet is B2:R500, I assume I need to change the VBA to reflect that?
 
Upvote 0
What's your validation list range. K2:K8 should be replaced by your validation list range. H2:H10 should be replaced by your validation range.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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