Here is the code I am using to do a Custom vlookup. It puts spaces in between the results. I need line breaks instead.
Function CusVlookup(lookupval, lookuprange As Range, indexcol As Long)
'updateby Extendoffice 20151118
Dim x As Range
Dim result As String
result = ""
For Each x In lookuprange
If x = lookupval Then
result = result & " " & x.Offset(0, indexcol - 1)
End If
Next x
CusVlookup = result
End Function
So instead of my data looking like this:
<tbody>
</tbody>
It'll look like this:
<tbody>
</tbody>
Someone said to replace: result = result & " " & x.Offset(0, indexcol - 1)
With: result = result & Chr(13) & x.Offset(0, indexcol - 1)
But that isn't working.
Please help.
Function CusVlookup(lookupval, lookuprange As Range, indexcol As Long)
'updateby Extendoffice 20151118
Dim x As Range
Dim result As String
result = ""
For Each x In lookuprange
If x = lookupval Then
result = result & " " & x.Offset(0, indexcol - 1)
End If
Next x
CusVlookup = result
End Function
So instead of my data looking like this:
Cabinet Type-G1 Inner Finisher-D1 Super G3 Fax Board-AK1 Inner Finisher Additional Tray-A1 |
<tbody>
</tbody>
It'll look like this:
Cabinet Type-G1 Inner Finisher-D1 Super G3 Fax Board-AK1 Inner Finisher Additional Tray-A1 |
<tbody>
</tbody>
Someone said to replace: result = result & " " & x.Offset(0, indexcol - 1)
With: result = result & Chr(13) & x.Offset(0, indexcol - 1)
But that isn't working.
Please help.