0

I am having a data in such format (DELIMITED TEXT)

Delimited Text Data

How do I Vlookup "F88" to get 1 dynamic value.

Vlookup particular data from the text

Thanks a ton

Sadsamosa
  • 11
  • 1
  • You have "DELIMITED TEXT" in a single cell. Like literally you have `'F88','66','149','','','53','13','45','11','92','43','','','' ` in one cell? And you want to look something up in that delimited text? This is entirely unclear what your SPREADSHEET looks like and what you are trying to do. – JNevill Mar 21 '18 at 14:05
  • @JNevill Yes Sir, – Sadsamosa Mar 21 '18 at 14:06
  • Why value `66` is returned when you input `F86`? Why not `149`? What is the logic here. What if I input `45`, would I get `11` back? – JNevill Mar 21 '18 at 14:07
  • @JNevill I did Update my question with images if it helps. – Sadsamosa Mar 21 '18 at 14:19

1 Answers1

0

With your posted data in A1, give this a try:

Sub DataGrsbber()
    Dim s As String
    s = Replace([A1], "'", "")
    ary = Split(s, ",")
    For i = LBound(ary) To UBound(ary) - 1
        If ary(i) = "F88" Then
            MsgBox ary(i + 1)
            Exit Sub
        End If
    Next i
End Sub

enter image description here

EDIT#1:

To retrieve the value into a cell, try this User Defined Function:

Public Function Retriever(BigString As String, LittleString As String) As String
    Dim s As String
    s = Replace(BigString, "'", "")
    ary = Split(s, ",")
    For i = LBound(ary) To UBound(ary) - 1
        If ary(i) = LittleString Then
            Retriever = ary(i + 1)
            Exit Function
        End If
    Next i
    Retriever = ""
End Function

enter image description here

Gary's Student
  • 95,722
  • 10
  • 59
  • 99