![]() |
#1
|
|||
|
|||
![]()
Hello everyone,
I've been trying to adapt to my needs the acronymlister macros I could find but I am stuck. I have Word tables containing acronyms of 3 uppercase letters or more. I would like to run the macro on selected tables to find the acronyms within it and to list them right after each table. The list of acronyms should be formatted as Quote:
Quote:
Please find below the code I have been working on. I annotated where I think the code should be changed. Other options are welcome ![]() Code:
Sub ACRO_table Dim oTbl as Table Dim oCel as Cell Dim oRange as Range For Each oTbl in Selection.Range.Tables For Each oCel In oTbl.Range.Cells With oCel.RangeWith .find .text = "<[A-Z]{3,}>" .forward = True .Wrap = wdFindStop .Format = False .MatchCase = True .MatchWildCards = TrueDo While .Execute ' the following lines of code are wrong i.e. it copies the found acronyms in new cells with new cells oTbl.Range.collapse wdCollapseEnd oTbl.Range.Copy oCel.Range.PasteAndFormat (wdTableOriginalFormatting) Loop End with End with Next oCel Next oTbl Winrow Last edited by Winrow; 06-18-2022 at 02:18 AM. Reason: typo in title |
Tags |
acronymlister macro, word table |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cross-reference with full context a numbered list inside another multilevel list (list style) | MatLcq | Word | 0 | 02-01-2021 06:00 AM |
![]() |
daithy | Word | 4 | 03-12-2020 01:52 PM |
numbered list: bold when selected and fade when selected following number | village | PowerPoint | 0 | 11-08-2017 10:43 AM |
![]() |
lsmcal1984 | Word | 3 | 09-04-2013 07:33 AM |
![]() |
ubns | Word | 1 | 08-02-2012 04:09 AM |