Hi all
I'm working on a simple project management tool for work. Nothing fancy, and no need for gantt or equal.
I have found multiple ways to do multiple lists so that is not a problem. The filter function does not work with the VBA function I used. I will link the code below.
Is there a smart way to be able to add multiple values to a cell and being able to filter out the individual value?
The typical list is names (project members) bound to a project. The cell needs to include more than one name and each person must be able to filter out his own name to see own tasks.
I'm working on a simple project management tool for work. Nothing fancy, and no need for gantt or equal.
I have found multiple ways to do multiple lists so that is not a problem. The filter function does not work with the VBA function I used. I will link the code below.
Is there a smart way to be able to add multiple values to a cell and being able to filter out the individual value?
The typical list is names (project members) bound to a project. The cell needs to include more than one name and each person must be able to filter out his own name to see own tasks.
VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim strVal As String
Dim i As Long
Dim lCount As Long
Dim Ar As Variant
On Error Resume Next
Dim lType As Long
If Target.Count > 1 Then GoTo exitHandler
lType = Target.Validation.Type
If lType = 3 Then
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 3 Then
If oldVal = "" Then
Else
If newVal = "" Then
Else
On Error Resume Next
Ar = Split(oldVal, ", ")
strVal = ""
For i = LBound(Ar) To UBound(Ar)
Debug.Print strVal
Debug.Print CStr(Ar(i))
If newVal = CStr(Ar(i)) Then
strVal = strVal
lCount = 1
Else
strVal = strVal & CStr(Ar(i)) & ", "
End If
Next i
If lCount > 0 Then
Target.Value = Left(strVal, Len(strVal) - 2)
Else
Target.Value = strVal & newVal
End If
End If
End If
End If
End If
exitHandler:
Application.EnableEvents = True
End Sub