title: VLookup multiple columns
body: <p>I am using VLookup function which looks up multiple values which are present in the column. This works very well but just takes a lot of time as I have 100,000 rows in the Excel sheet.  </p>
  
  <p>Is  there any way to quicken this code?</p>
  
  <p>The code basically looks up a particular value in a column and gets the offset. The difference between simple VLookup and this is that in case there are multiple rows with the same lookup value then it gets all the elements.</p>
  
  <pre><code>   Function VLookupAll(ByVal lookup_value As String, _
                  ByVal lookup_column As Range, _
                  ByVal return_value_column As Long, _
                  Optional seperator As String = ", ") As String
  
   Dim i As Long
   Dim result As String
  
  For i = 1 To lookup_column.Rows.Count
  If Len(lookup_column(i, 1).Text) &lt;&gt; 0 Then
      If lookup_column(i, 1).Text = lookup_value Then
          result = result &amp; (lookup_column(i).Offset(0, return_value_column).Text &amp; seperator)
      End If
  End If
  Next
  
  If Len(result) &lt;&gt; 0 Then
  result = Left(result, Len(result) - Len(seperator))
  End If
  
  VLookupAll = result
  
  End Function
  </code></pre>