Copy and paste the below UDF code in Standard Mudule.
Function GetData(sTxT As Range, fRng As Range, sRng As Range) As String
Dim i As Long, j As Long
GetData = ""
If sTxT <> "" Then
mytemp = Trim(sTxT.Value)
For i = 1 To fRng.Cells.Count
For j = 1 To sRng.Cells.Count
GetData = GetData & mytemp & Trim(fRng.Cells(i).Value) & Trim(sRng.Cells(j).Value) & ","
Next j
Next i
GetData = Mid(GetData, 1, Len(GetData) - 1)
End If
End Function
=getdata(First_Column_Cell,Second_Column_Range,Third_Column_Range)
Formula:
=getdata($A1,$B$1:$B$3,$C$1:$C$3)
Refer the attached file for details.
Hope this helps!
Bookmarks