Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #31  
Old 07-19-2015, 11:58 PM
macropod's Avatar
macropod macropod is offline Help with if then statements Windows 7 64bit Help with if then statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Try the attached. For your template, you will require all of the included code instead of what you now have for your 'TabbedCensus1790To1940Macro' and 'LockDD1' macros. I've also commented-out the .ExitMacro = "UnlinkFields" line in the code for testing purposes (plus that macro isn't in the code I'm returning).

As you will see, a complete re-write of your code was required. The code should now give you a good idea of how to use macros for conditional text & formfield insertion at nominated bookmarks. Note, too, that I've eliminated all of your IF fields. Given the need to conditionally insert multiple formfields, it didn't make sense having some of the processing done that way and the balance via macro coding when the latter handles the lot quite seamlessly.
Attached Files
File Type: docm Census.docm (40.8 KB, 29 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #32  
Old 07-20-2015, 01:17 PM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

Whoa! there's a lot to digest here! I would ask you to explain the why and how but that would take too long. Your help is much appreciated- Thanks-
Reply With Quote
  #33  
Old 07-21-2015, 03:53 AM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

Couple of things:
1) I need to take out the 1890 as there is no census for that decade.
2) When I create a toolbar for this doc both of the macros do not show up in the commands section. Why is that? Thanks-
Reply With Quote
  #34  
Old 07-21-2015, 04:45 AM
macropod's Avatar
macropod macropod is offline Help with if then statements Windows 7 64bit Help with if then statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 brent chadwick View Post
1) I need to take out the 1890 as there is no census for that decade.
the simplest solution for that is to change:
.Add Name:=i
to:
If i <> 1890 Then .Add Name:=i
Quote:
Originally Posted by brent chadwick View Post
2) When I create a toolbar for this doc both of the macros do not show up in the commands section. Why is that?
Are you adding the macros to your template and creating the 'toolbar' in that? Note, too, that the document I returned references Word's Normal template, not the template attached to post #30.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #35  
Old 07-25-2015, 10:59 AM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

With a few minor mods this code works perfectly-Thanks. Have you or anyone you know created a pull-down menu in the Quick Access Toolbar?
Reply With Quote
  #36  
Old 07-25-2015, 02:41 PM
macropod's Avatar
macropod macropod is offline Help with if then statements Windows 7 64bit Help with if then statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 brent chadwick View Post
Have you or anyone you know created a pull-down menu in the Quick Access Toolbar?
AFAIK that's not possible. Some items can be added via VBA, but not a dropdown.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with if then statements Multiple If statements, Jamal NUMAN Excel 16 11-15-2022 11:59 PM
Countif statements Alaska1 Excel 5 02-05-2015 07:55 PM
Help with if then statements Using IF statements stuwoolf Excel 2 01-10-2015 01:58 PM
Help with if then statements count if statements Alaska1 Excel 1 05-14-2014 08:21 AM
IF statements that shifts to right. kent Excel 0 01-19-2006 02:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:32 PM.


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