+ Reply to Thread
Results 1 to 6 of 6

Check Boxes to Hide/Unhide Text

  1. #1
    Registered User
    Join Date
    05-07-2020
    Location
    Madison, WI
    MS-Off Ver
    Office 365
    Posts
    3

    Check Boxes to Hide/Unhide Text

    Hello,

    I am new to using VBA for Word. I have template letter in which I need to have customized text populated for certain selections.
    I want to create a cover sheet that if certain check boxes are checked then it will display the corresponding text in the letter.

    Can someone help me write VBA code to use?
    I guess I don't know where to start.

    Thanks,
    Christina

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Check Boxes to Hide/Unhide Text

    What kind of checkbox?
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    05-07-2020
    Location
    Madison, WI
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Check Boxes to Hide/Unhide Text

    It's a content control check box.

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Check Boxes to Hide/Unhide Text

    OK, and how does the content control relate to the text? For example, are they both in a table cell, or is it and the variable content bookmarked? And what is to happen with the checkbox?

  5. #5
    Registered User
    Join Date
    05-07-2020
    Location
    Madison, WI
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Check Boxes to Hide/Unhide Text

    The content control boxes are labeled. If a certain box is checked then certain text should be unhidden. If the box is unchecked then the corresponding text should be hidden.
    I don't have this in a table/cells, but I could create a table for this. Otherwise, I don't know how to bookmark variable content.

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Check Boxes to Hide/Unhide Text

    See, for example, the attached.

    The document contains a checkbox and two bookmarked ranges whose names correspond to the checkbox title and tag, respectively. When you exit the checkbox, the content updates to reflect the checkbox state.

    The code that drives the process can be access via Alt-F11
    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. Hide and Unhide Worksheets with Check Boxes
    By kozakb in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-26-2018, 12:17 PM
  2. Using check boxes to hide and unhide worksheets
    By J_barber in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-12-2017, 04:27 AM
  3. Replies: 3
    Last Post: 02-20-2015, 01:26 PM
  4. [SOLVED] Hide and unhide row and columns to change text in text boxes
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2013, 01:30 PM
  5. I need a code for presence check to check multiple text boxes and combo boxes
    By Lee_wwfc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2013, 01:53 PM
  6. [SOLVED] Using Tick Boxes to Hide/ Unhide a selection of rows
    By Andrew E Smith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 12:36 PM
  7. Hide or Unhide worksheets in a workbook using check boxes
    By Kempfat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2012, 05:35 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