Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 04-08-2020, 06:56 AM
mrsandes mrsandes is offline Abbreviations Validation - Word Windows 10 Abbreviations Validation - Word Office 2019
Novice
Abbreviations Validation - Word
 
Join Date: Apr 2020
Posts: 10
mrsandes is on a distinguished road
Default

Quote:
Originally Posted by mrsandes View Post
Hi Paul,

Thanks for sharing this amazing macro, it is working.
However, I have tried modifying a few things to make it simpler without success... I wanted to have the generated table as only 2 columns, the abbreviations and the meaning. I would like to run a validation test on the abbreviations and meanings generated as well based on a pre-defined list that I have, to make sure only pre-approved abbreviations were used and with the pre-assigned meaning to them.

Would you see that as a possible thing with VBA?
I managed to get the validation part up and running using a third column to show the "result". The only thing I am struggling with now is taking out everything related to what the columns 3 to 5 did in the default macro and having the macro creating only 3 columns... Your help would be much appreciated.

Macro used for validation:

Code:
Sub Validate()
Application.ScreenUpdating = False

Dim Tbl As Table, r As Long, Abb_Fd As String, Def_Fd As String, x As Long
Dim accept As String, reject1 As String, reject2 As String
    
accept = "Approved"
reject1 = "Unapproved Abbreviation/Acronym"
reject2 = "Unapproved Definition to Abbreviation/Acronym"

Dim arrTerms(1, 1)

arrTerms(0, 0) = "A/C"
arrTerms(1, 0) = "AAR"
arrTerms(0, 1) = "Aircraft"
arrTerms(1, 1) = "Aircraft Architecture Review"
    
With ActiveDocument

  Set Tbl = .Tables(.Tables.Count)
  
  For r = 2 To Tbl.Rows.Count

      Abb_Fd = Split(Tbl.Cell(r, 1).Range.Text, vbCr)(0)
      Def_Fd = Split(Tbl.Cell(r, 2).Range.Text, vbCr)(0)
      
        For x = 0 To 364
        
            If Abb_Fd = arrTerms(x, 0) And Def_Fd = arrTerms(x, 1) Then
            Tbl.Cell(r, 3).Range = accept
            Exit For
            ElseIf Abb_Fd = arrTerms(x, 0) Then
            Tbl.Cell(r, 3).Range = reject2
            Exit For
            Else: Tbl.Cell(r, 3).Range = reject1
            End If
        Next x
    
  Next r
  
End With

Application.ScreenUpdating = True

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Abbreviations Validation - Word Creating a list of Acronyms / Abbreviations daithy Word 4 03-12-2020 01:52 PM
Data Validation in Microsoft Word Template BradleyCase Word VBA 1 07-16-2019 12:37 PM
Adding Professional Credential Abbreviations to Name dyny723 Outlook 0 03-16-2018 07:14 AM
Abbreviations Validation - Word Automate Job application word doc to Excel (with data validation) dylansmith Office 1 02-11-2018 12:58 PM
validation email address in word text filed sameerahmad_P Word VBA 1 03-07-2014 02:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft