Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 08-27-2018, 06:36 AM
Guessed's Avatar
Guessed Guessed is offline Push Word content control data and excel cells Windows 10 Push Word content control data and excel cells Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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

So you need to change the loop to only look for particular text CCs. I would do this by using the CC Title property to nominate which text CCs are meant to feed the XL workbooks
Code:
Function UpdateXL(xlWkBk As Object)
  Dim aCC As ContentControl, sSheet As String, sCell As String, sValue As String
  For Each aCC In ActiveDocument.SelectContentControlsByTitle("Excel Data")
    If aCC.Type = wdContentControlText Then
      sSheet = Split(aCC.Tag, "!")(0)
      sCell = Split(aCC.Tag, "!")(1)
      sValue = aCC.Range.Text
      xlWkBk.Sheets(sSheet).Range(sCell).Value = sValue
    End If
  Next aCC
End Function
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Push Word content control data and excel cells Importing content control data from excel and populate two fields on selected dropdown badarlodhi Word VBA 8 02-08-2023 10:47 AM
Push Word content control data and excel cells Export Word Drop-Down Content Control to Excel Specific Sheet nolanthomas32 Word VBA 4 09-19-2017 06:25 AM
Push Word content control data and excel cells Edit table cells based on content control selection gennatr12 Word VBA 7 03-26-2017 08:51 PM
Push Word content control data and excel cells Content Control Copy - Copies Data and CC itself shammi_raj Word 3 03-30-2016 07:01 PM
Push Word content control data and excel cells Push data automatically from Acess or Excel to create a Gantt chart in Project GST2212 Project 3 07-06-2012 12:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft