May 23, 2005 #1 frobo Programmer May 13, 2005 14 CH how i can iterate with vba code through a semicolon seperated list saved in a table field? tia
May 23, 2005 #2 PHV MIS Nov 8, 2002 53,708 FR Take a look at the Split function (ac2k or above). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Take a look at the Split function (ac2k or above). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
May 23, 2005 #3 jebry Programmer Aug 6, 2001 3,006 US Hi! If you don't have the split fuction available try this: Dim lngPosition As Long Dim lngFirstPosition As Long Dim strInformation As String lngFirstPosition = 0 lngPosition = InStr(YourDelimitedString, ";") While lngPosition <> 0 If lngFirstPosition = 0 Then strInformation = Left(YourDelimitedString, lngPosition - 1) Else strInformation = Mid(YourDelimitedString, lngFirstPosition + 1, lngPosition - lngFirstPostion - 1) End If (Do your stuff to strInformation here) strFirstPosition = strPosition strPosition = InStr(strPosition + 1, YourDelimitedString, ";") Loop hth Jeff Bridgham bridgham@purdue.edu Upvote 0 Downvote
Hi! If you don't have the split fuction available try this: Dim lngPosition As Long Dim lngFirstPosition As Long Dim strInformation As String lngFirstPosition = 0 lngPosition = InStr(YourDelimitedString, ";") While lngPosition <> 0 If lngFirstPosition = 0 Then strInformation = Left(YourDelimitedString, lngPosition - 1) Else strInformation = Mid(YourDelimitedString, lngFirstPosition + 1, lngPosition - lngFirstPostion - 1) End If (Do your stuff to strInformation here) strFirstPosition = strPosition strPosition = InStr(strPosition + 1, YourDelimitedString, ";") Loop hth Jeff Bridgham bridgham@purdue.edu