Input:
##TABLE_START##
##ROWS=3
##COLS=2
##Value
##Decode
##0
##Clock running
##1
##Clock not running
##TABLE_END##
##TABLE_START##
##ROWS=4
##COLS=2
##Value
##Decode
##0
##Off
##1
##On
##Z
##High Z
##TABLE_END##
Desired output:
I want to do this for about 400 tables. I tried recording a macro in word, but it locks the mouse when recording the macro, and it just records the absolute keys hit. I would like to do something more general that searches for ##TABLE_START##
, parses all the rows until ##TABLE_END##
, then builds a table at the bottom of the document filled in with the appropriate information.
Current Code Word VBA 2010: (Just a snippet of the code -- It just recorded the keystrokes whereas I want to make something that works for every table)
The copy and paste is good, but I need to change how the selection is made to be more general and work for every table
Selection.MoveDown Unit:=wdLine, Count:=7
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Selection.MoveUp Unit:=wdLine, Count:=6
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.MoveDown Unit:=wdLine, Count:=7
Selection.PasteAndFormat (wdFormatOriginalFormatting)