For x = 1 To CountFields("Mary Had A Little Lamb", " ")
sAbreviation = sAbreviation & Left(nthField(Mary Had A Little Lamb",x), 1)
Next
sAbreviation = "MHALL" after the loop above (In REAL BASIC) is there something similar in VBA?
I have a workaround but it sure feels clunky
Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.
sAbreviation = sAbreviation & Left(nthField(Mary Had A Little Lamb",x), 1)
Next
sAbreviation = "MHALL" after the loop above (In REAL BASIC) is there something similar in VBA?
I have a workaround but it sure feels clunky
Code:
Sub main()
sOriginalString = "Mary Had A Little Lamb"
sStringSplit = Split(sOriginalString, " ")
For x = LBound(sStringSplit) To UBound(sStringSplit)
sAbbreviation = sAbbreviation & Left(sStringSplit(x), 1)
Next
MsgBox "final = " & sAbbreviation
End Sub
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
I think I've forgotten this before.