![]() |
|
#4
|
||||
|
||||
|
This code should work if your selection is of complete table rows. It also works with discontinuous selections.
Code:
Sub MoveARow()
Dim activeListCells As Range, aLO As ListObject, aLO2 As ListObject
Set aLO = ActiveWorkbook.Sheets("ForEdit").ListObjects("tForEdit")
Set aLO2 = ActiveWorkbook.Sheets("Edited").ListObjects("tEdited")
Set activeListCells = Intersect(aLO.DataBodyRange, Selection)
If activeListCells Is Nothing Then
MsgBox "List row not selected"
Else 'assumes the selection is of complete table rows
aLO2.ListRows.Add
activeListCells.Copy aLO2.ListRows(aLO2.ListRows.Count).Range.Cells(1, 1)
activeListCells.Delete
End If
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting Blank Space between table heading and table rows | Pete Jones | Word Tables | 5 | 01-22-2018 04:11 PM |
Duplicating one or more table rows or an entire table with content controls
|
kevinbradley57 | Word VBA | 10 | 08-17-2017 02:13 PM |
Move table cell contents from one table to another table or cell in same table
|
donaldadams1951 | Word VBA | 4 | 02-04-2015 03:54 PM |
Is it possible to copy non-contiguous rows of a Table and paste them as a separate Table in Word?
|
Joey Cheung | Word Tables | 1 | 08-12-2014 05:15 PM |
Grouping table rows to prevent individual rows from breaking across pages
|
dennist77 | Word | 1 | 10-29-2013 11:39 PM |