![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
The problem is that you are counting controls to determine which column to fill. The macro has no way of knowing that you have removed a control so it works on the basis that the new count is correct. You need to address the controls by name and fill the column related to that control name e.g.
Code:
For Each CCtrl In .ContentControls Select Case CCtrl.Title Case "Title1": WkSht.Cells(i, 1) = CCtrl.Range.Text Case "Title2": WkSht.Cells(i, 2) = CCtrl.Range.Text 'etc End Select Next oCC
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Sammie0Sue | Word VBA | 21 | 01-12-2021 04:44 PM |
![]() |
rgburridge | Word VBA | 4 | 01-27-2015 02:37 PM |
Word 2010 Macro Enabled Template with Content Controls | keen1598 | Word VBA | 7 | 01-29-2014 03:17 PM |
![]() |
Sammie0Sue | Word | 6 | 11-06-2013 10:56 PM |
Macro to link 2 content controls | bortonj88 | Word VBA | 2 | 08-21-2012 06:24 AM |