Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-30-2016, 04:55 AM
emmanpelayo emmanpelayo is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jul 2015
Posts: 22
emmanpelayo is on a distinguished road
Default Word help


Someone has done this coding for me before. Very very thankful to Paul!! However, I needed to revise the report, so here I am again. I have attached the file, and what I am aiming for is in the comments in review. I am hopeless at this. Please can someone help me? Thanks!
Attached Files
File Type: docm DRAFT Ascot Report.docm (135.3 KB, 3 views)
Reply With Quote
  #2  
Old 06-30-2016, 12:26 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,671
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

For the first problem, you could edit the macro, changing:
If (i = 1) Or (i = .Tables.Count) Then Exit Sub
to:
If (i < 4) Or (i = .Tables.Count) Then Exit Sub

It's not clear what you want regarding the second problem. It seems to me the code already does that.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 07-09-2016, 06:58 AM
emmanpelayo emmanpelayo is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jul 2015
Posts: 22
emmanpelayo is on a distinguished road
Default

Thanks, Paul. After that change, The red parts are sorted. But for the Green ones, only the second to fourth set of tables work when I click the "add new SBAR set". I've made 5 sets of the tables in this file. 1st and 5th sets are not working. Thanks again!
Attached Files
File Type: docm DRAFT Mercy Report.docm (484.0 KB, 4 views)
Reply With Quote
  #4  
Old 07-10-2016, 12:37 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,671
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

IIRC, the original code was for a document that had a final table after all the input tables. Therefore the macro was coded to ignore the last table. I also didn't notice that the 'Comments' cell was part of the table above. To handle the new arrangement, change:
If (i < 4) Or (i = .Tables.Count) Then Exit Sub
to:
If (i < 3) Then Exit Sub
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 07-11-2016, 09:41 PM
emmanpelayo emmanpelayo is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jul 2015
Posts: 22
emmanpelayo is on a distinguished road
Default

Thanks!!!! All working now! You're a legend!!!
Reply With Quote
  #6  
Old 07-15-2016, 03:21 AM
emmanpelayo emmanpelayo is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jul 2015
Posts: 22
emmanpelayo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
IIRC, the original code was for a document that had a final table after all the input tables. Therefore the macro was coded to ignore the last table. I also didn't notice that the 'Comments' cell was part of the table above. To handle the new arrangement, change:
If (i < 4) Or (i = .Tables.Count) Then Exit Sub
to:
If (i < 3) Then Exit Sub
I have one last request. I was hoping you could help again Paul... Please see the comment inserted. Thanks again!!!
Attached Files
File Type: docm DRAFT Mercy Report.docm (121.2 KB, 1 views)
Reply With Quote
  #7  
Old 08-14-2016, 11:27 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,671
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

See attached. I've been O/S for the past month, so haven't had a chance to address this before now.
Attached Files
File Type: docm DRAFT Mercy Report.docm (119.0 KB, 5 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -7. The time now is 06:50 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft