VBA Line Break
chris
-
f894009 Posted messages 17417 Registration date Status Membre Last intervention -
f894009 Posted messages 17417 Registration date Status Membre Last intervention -
Bonjour,
I am looking for a VBA code that allows me to insert a line break after each found result during a lookup.
The current code used is as follows:
Thank you!!!
I am looking for a VBA code that allows me to insert a line break after each found result during a lookup.
The current code used is as follows:
Function VLooKupList(SearchValue As Range, SearchTable As Range, ColumnNumber As Integer, SEPARATOR As String) As Variant Dim RowCount As Integer RowCount = SearchTable.Rows.Count Dim FoundValuesCounter As Integer FoundValuesCounter = 0 For i = 1 To RowCount If SearchTable(i, 1).Value = SearchValue.Value Then FoundValuesCounter = FoundValuesCounter + 1 If FoundValuesCounter > 1 Then VLooKupList = VLooKupList & Chr(10) & SearchTable(i, ColumnNumber).Value Else VLooKupList = SearchTable(i, ColumnNumber).Value End If End If Next i End Function
Thank you!!!