View Single Post
 
Old 04-07-2020, 06:47 AM
mrsandes mrsandes is offline Windows 10 Office 2019
Novice
 
Join Date: Apr 2020
Posts: 10
mrsandes is on a distinguished road
Question Abbreviations Validation - Word

Hi guys,

I have been reading a lot through the topics here but couldn't find the help for what I need.
I'm not an expert in macros but I have been working on a project that requires me to do some VBA macros to support others.

I'm currently working on a macro which aims on finding pre-defined abbreviations within a document and having them listed in a certain table in the document with their definitions.

As I have over 300 abbreviations pre-defined, I thought of looping the "find" with something around the following code:

Code:
Sub Abbreviations()

Dim x As Integer
Dim result As String

abb1 = "A/C"
abb2 = "AAR"
def1 = "Aircraft"
def2 = "Aircraft Architecture Review"

For x = 1 To 2

    result = "abb" & x

Debug.Print ("Result: " + result)

    Next x
    
End Sub
However, instead of showing me the result as previously defined, it showed me "abb1" and "abb2" for x = 1 and 2.

Would you guys know how to make it show what was pre-defined, instead?

Thanks in advance.
Reply With Quote