Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 12-20-2013, 09:42 PM
macropod's Avatar
macropod macropod is offline programmatically inserting hidden text into a Word 2010 table Windows 7 32bit programmatically inserting hidden text into a Word 2010 table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by epid011 View Post
We want each cell to have an ID # so that in case a new row gets inserted into a table in the future, none of the existing cell references would have to be changed.
Maintaining tables with hard-coded cell references that might not reflect their true addresses creates an unnecessary maintenance headache.



I recommend that you accept that the data outputs might occasionally need to be modified to reflect changed reporting requirements. Might I also suggest that you output the data in a more compact pipe-delimited format that could be parsed quite easily without the need for cell references.

With the attachment, I've merged your two tables numbered 3.3.6.1.1 into one and have bookmarked it 'Table_3_3_6_1_1' (a more meaningful name might be better, so the code doesn't get tied to an out-dated table index #). I've also included a suggested data file for a macro to process - plus the code to do so. Simply copy the document & data file to the same folder, then run the macro. As constructed, the data file contains all the cell data from your post, plus some dummy data for the 2nd tertile, for which you apparently require nothing as yet for 'IV BP only'. The data file accommodates that with what is essentially an empty line. The data file contains one line per table row. It also accommodates the addition of new lines and having data for multiple tables in the same data file (you could data for a table bookmarked 'Table_3_3_6_1_1A' and for another table, bookmarked 'Table_3_3_6_1_1B', for example). The code (updated) allows for table rows to have different column counts to populate, even within the same table.
Attached Files
File Type: zip Table 3.3.6.1 - for testing.zip (20.7 KB, 11 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 12-21-2013 at 11:07 PM. Reason: Updated code in attachment
Reply With Quote
  #17  
Old 12-30-2013, 11:29 AM
epid011 epid011 is offline programmatically inserting hidden text into a Word 2010 table Windows 7 64bit programmatically inserting hidden text into a Word 2010 table Office 2010 32bit
Novice
programmatically inserting hidden text into a Word 2010 table
 
Join Date: Dec 2013
Posts: 12
epid011 is on a distinguished road
Default

Thanks for the advice; it's very helpful. I appreciate the code samples.
Reply With Quote
Reply

Tags
vba, vba word, word table



Similar Threads
Thread Thread Starter Forum Replies Last Post
programmatically inserting hidden text into a Word 2010 table getting rid of hidden text in MS word allenglishboy Word 1 11-06-2012 05:48 PM
programmatically inserting hidden text into a Word 2010 table Hidden text in table Angel9520 Word Tables 1 05-02-2012 01:00 AM
programmatically inserting hidden text into a Word 2010 table Hidden style applied over already-hidden text. christie Word 1 08-17-2011 09:10 AM
inserting a string of data into an MS Word table??? matto Word VBA 0 07-16-2010 09:35 AM
Programmatically get File Path for currently opened WORD document franferns Word 1 11-26-2009 12:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:56 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