![]() |
|
#1
|
|||
|
|||
![]()
try changing
.Cells(1). to .Range.Cells(1). |
#2
|
|||
|
|||
![]()
That did not work.
![]() I found this code online and adjusted it to copy three rows with contentcontrols to 3 new rows. However I cannot add this code to my document that contains many tables. This would be the 7th Table. As a novice I am unclear how to specify that this code applies only to Table 7. Code:
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl) Dim p_oTargetRow As Word.Row With Selection.Range If .Information(wdWithInTable) Then If .Cells(1).RowIndex = .Tables(1).Range.Cells _ (.Tables(1).Range.Cells.Count).RowIndex Then If .Cells(1).ColumnIndex = .Tables(1).Range.Cells _ (.Tables(1).Range.Cells.Count).ColumnIndex Then If MsgBox("This is the last row/last cell." _ & " Do you want to ADD a new Performance Goal ROW?", _ vbQuestion + vbYesNo, "New Row") = vbYes Then InsertRowWithContent End If Set p_oTargetRow = Selection.Rows(1) End If End If End If End With End Sub |
![]() |
Tags |
content controls, rows |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
![]() |
ejtoll | Word Tables | 1 | 12-05-2012 05:09 PM |
Adding columns in specific rows only | mhays | Excel | 5 | 01-17-2012 09:13 AM |
![]() |
Stephan Lindner | Word Tables | 1 | 09-10-2011 05:31 AM |
![]() |
hklein | Word VBA | 4 | 07-18-2011 12:21 AM |