View Single Post
 
Old 01-14-2019, 11:38 AM
0rion 0rion is offline Windows 10 Office 2010
Novice
 
Join Date: Jan 2019
Posts: 11
0rion is on a distinguished road
Default

The first part was just to say that most 'acronym-making' scripts I found don't work with hyphenated words. The script I showed does. I'd just like to include the hyphens in the end result.

Actually, this code of yours works well:
Code:
Function abbrev(aString$) As String
  Dim a, b, i As Integer
  a = Split(aString, "-")
  b = a
  For i = 0 To UBound(a)
    b(i) = Acronym(CStr(a(i)))
  Next i
  abbrev = Join(b, "-")
End Function
although I notice that if there is a space after the hyphen it will show up in the acronym. Can that be fixed?
Reply With Quote