vba_pwning_me
New Member
- Joined
- Jan 11, 2022
- Messages
- 4
- Office Version
- 365
- 2021
- 2019
- 2016
- Platform
- Windows
I have been increasingly frustrated so hopefully someone can help me. I'm trying to run the Filter(proj_name, assign_to = Target.Address) function in vba and store the results in a variable but I keep getting Error 2015 on my debug.
The idea is that I would like to store the array subset returned from the Filter function in a variable. Depending on what items are listed in the array their cells would have a different fill color. Here's what I have so far:
The idea is that I would like to store the array subset returned from the Filter function in a variable. Depending on what items are listed in the array their cells would have a different fill color. Here's what I have so far:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim SecCells As Variant
' The variable KeyCells contains the cells that will
' refer to column A on the Assignment Map tab .
Set KeyCells = Range("assign_prsnl")
SecCells = Application.Filter(proj_name, assign_to = Target.Address)
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
For x = LBound(SecCells) To UBound(SecCells)
Debug.Print SecCells
Next x
End If
End Sub