+ Reply to Thread
Results 1 to 1 of 1

Show/Hide Tables and CC, paired with Repeated CC

  1. #1
    Registered User
    Join Date
    09-20-2019
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    1

    Show/Hide Tables and CC, paired with Repeated CC

    Hello! New guy not well versed in VBA -at all- and learning as I google searched ways to accomplish what I wanted. That all led me here, the seeming best place for Word VBA questions.

    I drafted the attached document in hopes of creating a "better" progress report sheet for work. I plan(or hope?) to have the last table (date/issue/action) before the "goal example" area to have a repeated content control(can't add it on current PC, Office2010).
    Let's say clients get weekly reviews. We want to be able to click for another "clean" row of the repeated content (sanction/incentive areas) to be able to log the next review period, and enter all new information in the drop downs for what happened during that next session. A week after, hit the button for repeated content, enter new info for that week on the new row...aka...an advanced version of "tabbing for another table line."

    That's obviously not my question or issue however. With formatting that bottom part of the table regarding sanction/incentives, I have never really been satisfied in it's layout and continue to putz with it. Trying to conserve space I'm listing two different data points in the same area (did the person get a sanction?, did they get an incentive?) instead of one table that just has sanctions and one table separate below that is only incentive info.

    My desire is to utilize show/hide and create checkboxes (or something) to toggle between the different option of "sanctions options" or "incentives options" dropdowns. I know with checkboxes they could both be potentially clicked and be active. It's very very very unlikely for someone get an incentive and sanction in the same session so if there is a simplier method without checkboxes purely to toggle the repeated content control back and forth between those two options depending on what happens in the review.

    Backing up a bit more, is it even possible to for my idea to work - checkboxes or other? The problem with all the test code I've found so far that it fails in some regard, but it seems if I combined all the little pieces they'd all mesh up but I'm not adept in code/VBA.

    Like with fumei's code on VBAExpress below. I played around with the table hide/show and the bookmark hide/show with varying success and limitations. I was suave enough to figure out I had to flip flop all the true/false on check boxes so it would be hidden when unchecked and removing .showAll to get rid of the darn paragraph lines, but otherwise I'm not good at this.

    With the table option, Problem 1, it only works with the "next" table. If I put the code at the very top of my document, it would essentially hide it all due to the top being tables. Problem 2, I tried putting the code inside my existing table with the "sanction/incentive" areas to build an inner table to show/hide for sanction, and one for incentives....this only hide the ENTIRE table it was inside including the checkboxes, not just the individual table I was hoping. Problem 3, repeated content controls didn't play nice with this since it was referencing specific tables....such as, it repeated all the content boxes and the checkboxes didnt work since they didn't reference anything being new boxes objects(name) not built into the macro(I'd suspect?).

    I can say I am a word NEWBIE and have never used bookmarks either(what can I say, I like "learning on the job." ) But with that said, I tried the other code snippet re: using bookmarks to show/hide. This seemed a bit better as I was able to "bookmark" some of the content controls to show the "proof of concept" that I could potentially show/hide them also tied to the checkbox as I fiddled with the code a bit. It seemed this would work really well and easy, but then I hit more snags. Problem 1, I thought the independent checkboxes and variables that i created when I duplicated the code snipe for the 2nd checkbox worked, but I was wrong. I realized that it doesnt work appropriately with two checkboxes and the show/hide, as clicking either one essentially show/hid all the text on the document at large vs. specific to it's button. After googling more, seems like maybe the .showAll for the document is the issue and I'm not smart enough to know how to code around it? Specific way to call only the specific hidden area and not all hidden text on the document?

    Thank you in advance!

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add numbers and show repeated nrs.
    By Seafreight Discounte in forum Excel General
    Replies: 0
    Last Post: 01-17-2018, 02:14 PM
  2. [SOLVED] Message Box pop up to show a cell has been repeated
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2015, 12:31 AM
  3. [SOLVED] Need to hide repeated values in balance column
    By andyzz in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-26-2014, 09:25 PM
  4. [SOLVED] How do i show repeated values (Pivot table)
    By ThomasCarter in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 11-08-2012, 09:27 AM
  5. lookup Repeated Text and show Data
    By DRAGONman in forum Excel General
    Replies: 19
    Last Post: 06-13-2012, 02:16 PM
  6. Show/Hide multiple Pivot Tables on a single worksheet
    By Reginald888 in forum Excel General
    Replies: 0
    Last Post: 08-25-2009, 02:18 PM
  7. Excel Pivot Tables Show and Hide Specific Items
    By Ruth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2005, 11:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1