Multiple Entries Selected On Drop Down List highlights row

hombrelobo

New Member
Joined
May 27, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

Can someone please point me in the right direction, still a rookie with Excel! Please see image below for details.

Goal is for when cell E2 has multiple items selected from the drop down list ( in this case more than 1 medication) it would highlight the row . Already enabled drop down list for multiple entries.

Would I use a formula with conditional formatting

1622152644450.png
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi & welcome to MrExcel.
When multiple items are selected what separator is used?
 
Upvote 0
Hi and thank you.

I inserted the following VBA Code to enable to the mulitple selection of items from the drop down list. Not sure what "separator" is used.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Column = 5 Or Target.Column = 6 Or Target.Column = 7 Or Target.Column = 8 Or Target.Column = 9 Then
  If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
    GoTo Exitsub
  Else: If Target.Value = "" Then GoTo Exitsub Else
    Application.EnableEvents = False
    Newvalue = Target.Value
    Application.Undo
    Oldvalue = Target.Value
      If Oldvalue = "" Then
        Target.Value = Newvalue
      Else
        If InStr(1, Oldvalue, Newvalue) = 0 Then
            Target.Value = Oldvalue & vbNewLine & Newvalue
      Else:
        Target.Value = Oldvalue
      End If
    End If
  End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
 
Last edited by a moderator:
Upvote 0
Ok, select A2:E last row & in conditional formatting, new rule, use a formula & use
Excel Formula:
=FIND(CHAR(10),$E2)
 
Upvote 0
Solution
AWESOME it worked I will have to study the "FIND" formula! My next step would be to figure out how to enable via VBA how to deselect an item on the cell once it longer being used. (med is no longer being taken!)

Thanks again!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

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