How to get an Acronym using Excel VBA?

The purpose of the following example of Excel VBA macro is to get the acronym or an abbreviation of each of the first letter of any given words.

Function Acronym(Words As Variant) As String

    Dim aWord() As String, ix As Integer

    aWord = Split(Words.Value, " ")
    For ix = 0 To UBound(aWord)
        Acronym = Acronym & UCase(Left(aWord(ix), 1))
    Next ix

End Function

Using Split function and space as delimiter, we create an array of word. Then using simple for … to loop, we do looping of each word and take the first letter of each word in array using Left function.

By using iteration and array like this, we will get the acronym of the word in question.

We can directly use the function in Excel formula bar with a reference to the cell that contains the collection of words we want to make an acronym from it as input.

acronym

For the details information of each function in use, Split/Ucase/Left, select each function and push F1 while in the Visual Basic Editor.

This entry was posted in Excel Formula and tagged , , , , , , . Bookmark the permalink.

799 Responses to How to get an Acronym using Excel VBA?

  1. JP says:

    You can also do this with a formula.

    =LEFT(A1,1)&MID(A1,FIND(” “,A1)+1,1)&MID(A1,FIND(” “,A1,FIND(” “,A1)+1)+1,1)

  2. JP, you are the best :D

  3. Pingback: debt consolidation companies

  4. Pingback: reverse mortgage calculator

  5. Pingback: debt consolidation programs

  6. Pingback: debt consolidation loan

  7. Pingback: debt help

  8. Pingback: reverse mortgage companies

  9. Pingback: debt consolidation companies

  10. Pingback: Alternative Energy Projects

  11. Pingback: white label dating

  12. Pingback: debt collection agency

  13. Pingback: collection agency rates

  14. Pingback: rapidrecoverysolution.com

  15. Pingback: Dog Snuggie

  16. Pingback: Pop Over HERE

  17. Pingback: free credit report no credit card

  18. Pingback: Rollercoaster Creator

  19. Pingback: How to test drive cars

  20. Pingback: Know your car

  21. Pingback: rewardzone mastercard

  22. Pingback: wedding photographer calgary

  23. Pingback: uv light air purifiers

  24. Pingback: hier klicken

  25. Pingback: ??????????? pc

  26. Pingback: schnell abnehmen

  27. Pingback: mens silver bracelet

  28. Pingback: Escorts Montreal

  29. Pingback: Tucson Realtor

  30. Pingback: Buy Quality Backlinks

  31. Pingback: Gaming Keyboard Review

  32. Pingback: Compare Car Quotes

  33. Pingback: red deer photographer services

  34. Pingback: Radiology technician salary in NJ

  35. Pingback: amazon coupons amazon coupons

  36. Pingback: ???????? new single

  37. Pingback: tatuaggi lettere

  38. Pingback: devis assurance auto

  39. Pingback: web design

  40. Pingback: tide coupon 2012

  41. Pingback: Th Cannabis Seeds

  42. Pingback: free money poker

  43. Pingback: best wallet

  44. Pingback: De Vestir Juegos

  45. Pingback: sexe amateur

  46. Pingback: SEO Services

  47. Pingback: pleasure bon bon

  48. Pingback: permanent magnet generator

  49. Pingback: ????? ????

  50. Pingback: Forex Trading

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>