I figured out how to solve my problem. I ended up using VBA instead of a function. If anyone is also trying to do the same thing I have posted my code below:
Sub GetResponses()
Dim RA As String
Dim Words As String
Dim FRow As Integer
Dim FindRA As String
Dim FindRM As String
Dim y As Integer, z As Integer, b As Integer, c As Integer, a As Integer
Dim RM As String
Dim Row1 As Long
Dim Words2 As String
Dim WordsCombined As String
Dim Col As String
Dim ColumnNumber As Long
Dim RowResp As Integer
Worksheets("Survey Data").Activate
Row1 = Sheets("Survey Data").Cells(Rows.Count, "A").End(xlUp).Row + 1 'This will show the last column with data
a = 2
RA = Worksheets("Survey Scores").Range("B5")
y = 3
z = 1
b = 1
ColumnNumber = 29
RowResp = 24
c = 1
Do Until c = 3
Col = Split(Cells(1, ColumnNumber).Address, "$")(1)
Do Until b = 11
Do Until a = Row1
RM = Worksheets("Survey Scores").Cells(6, y).Value
FindRA = Worksheets("Survey Data").Range("K" & a)
FindRM = Worksheets("Survey Data").Range("H" & a)
If FindRA = RA And FindRM = RM Then
Worksheets("Survey Data").Range("K" & a).Select
FRow = ActiveCell.Row
Words = Worksheets("Survey Data").Range(Col & FRow).Value
If Words <> "" And Words <> "N/A" Then
Words2 = z & ": " & Words & " "
WordsCombined = WordsCombined & Words2
z = z + 1
End If
a = a + 1
Else
a = a + 1
End If
Loop
Worksheets("Survey Scores").Cells(RowResp, y) = WordsCombined
WordsCombined = ""
a = 2
z = 1
y = y + 2
b = b + 1
Loop
c = c + 1
y = 3
ColumnNumber = ColumnNumber + 3
RowResp = RowResp + 1
b = 1
Loop
Worksheets("Survey Scores").Activate
End Sub
This code find 2 variable (one of the variable changes after the first loop) and if there is a match it grabs the cell and put it into a variable and will continue to grow till the loop is finished. I reset the variable after each loop.
Bookmarks