If i had this column:
ColA
-----
NUMBER(8,3)
NUMBER(20)
I need a VBA function that would go (note these start and end string would only eve
If I have a cucumber table as test data in a cell, and need to access the value under 'Header 1' between 4th and 5th pipes, below is how I done it. My table example as below in cell D7 :
*Cell D7:
code to access 'abcd' which is found after 4th occurrence of '|' and before 5th occurrence of '|'
Dim sheet5 As Worksheet
Dim i As Integer
Dim k As Integer
Dim openPos As Long
Dim clsPos As Long
Dim textBetween as String
'Using for loop to find 4th occurrence of pipe '|' for openPos
For i = 1 To 4
openPos = InStr(openPos + 1, sheet5.Range("D7"), "|", vbTextCompare)
Next i
'Using for loop to find 5th occurrence of pipe '|' for clsPos
For k = 1 To 5
clsPos = InStr(clsPos + 1, sheet5.Range("D7"), "|", vbTextCompare)
Next k
'Displaying the value between openPos and clsPos
txtBetween = Mid(sheet5.Range("D7").Value, openPos + 1, clsPos - openPos - 1)
MsgBox ("Current Header 1 value: " & txtBetween)