View Single Post
 
Old 01-18-2024, 03:42 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If your H/M/L tables are always appearing in that order at the top of the document then your macros might work like this
Code:
Sub MoveIt_High()
  ILikeToMoveIt
End Sub

Sub MoveIt_Medium()
  ILikeToMoveIt 2
End Sub

Sub MoveIt_Low()
  ILikeToMoveIt 3
End Sub

Function ILikeToMoveIt(Optional iTbl As Integer = 1)
  Dim aRng As Range, aTbl As Table, aRow As Row
  Set aRng = Selection.Paragraphs(1).Range
  aRng.End = aRng.End - 1
  Set aTbl = ActiveDocument.Tables(iTbl)
  Set aRow = aTbl.Rows.Add
  aRow.Cells(1).Range.FormattedText = aRng.FormattedText
End Function
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote