Offset index then concatenate in a textbox

I have an index column (W4:W293) that starts at "1" and ends at "288". In column (AA4:AA293) there could be an empty cell or a value of one to five. What I need is to lookup the corresponding number in column W if the value is greater than three in column AA. Then populate a textbox with the index values separated by a comma.

Attached is a spreadsheet to aid in visualization.

Thanks in advance!
test.xlsx
jcgrooveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Let's GoCommented:
Here is a user-defined function ConcatenateIf,  which is slightly adjusted from an excellent UDF posted by HansV MVP at https://answers.microsoft.com/en-us/office/forum/office_2010-excel/concatenate-values-that-meet-certain-conditions/b8e0f294-de85-4b30-bba3-c79d9bc4982f.
Function ConcatenateIf(CriteriaRange As Range, _
        ConcatenateRange As Range, Optional Separator As String = ",") As Variant
    Dim i As Long
    Dim strResult As String
    On Error GoTo ErrHandler
    If CriteriaRange.Count <> ConcatenateRange.Count Then
        ConcatenateIf = CVErr(xlErrRef)
        Exit Function
    End If
    For i = 1 To CriteriaRange.Count
        If CriteriaRange.Cells(i).Value >= 3 Then
            strResult = strResult & Separator & ConcatenateRange.Cells(i).Value
        End If
    Next i
    If strResult <> "" Then
        strResult = Mid(strResult, Len(Separator) + 1)
    End If
    ConcatenateIf = strResult
    Exit Function
ErrHandler:
    ConcatenateIf = CVErr(xlErrValue)
End Function

Open in new window


You can refer to this UDF from any cell in the workbook; I am not sure off the top of my head how to put the answer into a text box.
test.xlsm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Let's GoCommented:
Attached is a revised version which uses a cell (W1) to calculate the list, then puts it into a text box.
test.xlsm
0
jcgrooveAuthor Commented:
I just used the "Linked cell" property of my active-x textbox and it worked!
0
jcgrooveAuthor Commented:
I couldn't get the textbox to populate.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.