+ Reply to Thread
Results 1 to 4 of 4

Thread: Selective printing (via checkboxes)

  1. #1
    Registered User
    Join Date
    01-17-2012
    Location
    Tilburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Unhappy Selective printing (via checkboxes)

    Hi all,

    After many frustrating hours behind my desk, I hope to find the answer over here.

    For my work (unfortunately I cannot upload the original file) I have build a database with questions for a questionair (see the attachment for an example).
    The first sheet/tab is a form in which one can check certain boxes to print the questions that go with the checkbox.

    In tabs 2 and 3 (beer and wine in the example) a list of questions is visable, first in dutch and then in english.
    By checking the boxes on the first sheet, I would like excel to print the questions that are applicable to that checkbox.
    For example, when I check summer on the first page, I want excel to print all questions that are "selected" under summer with the letter "X" in sheets two and three.

    However, I can't get this to work even for a bit.
    Is there someone that can help me?

    Would be very much appreciated!


    example.xlsx

  2. #2
    Registered User
    Join Date
    01-17-2012
    Location
    Tilburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Selective printing (via checkboxes)

    Nobody?

  3. #3
    Registered User
    Join Date
    01-17-2012
    Location
    Tilburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Selective printing (via checkboxes)

    Can someone please shine a light on this problem?
    Would be very much appreciated!

  4. #4
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: Selective printing (via checkboxes)

    Als je een keuze van 2 hebt: zomer/winter lijkt mij 1 vinkvak voldoende...: aan: zomer, uit winter.
    Dat maakt de kolommen in de volgende bladen ook eenvoudiger: de kolom 'zomer' hoeft alleen maar een X te bevatten als die vraag van toepassing is in de zomer.

    Put all the question into 1 worksheet.
    Add 4 columns after the questions: language, season, gender & subject.
    Never use merged cells !!
    Use only 4 checkboxes and name them checkbox 1,2,3,4 respectively.
    You can use autofilter in the sheet that contains the questions to filter the questions that meet the criteria:
    autofilter j, "X"
    or don't meet the criteria

    autofilter j, "<>x"
    Sub snb()
      ReDim sn(3)
    
      For Each fc In Sheet1.CheckBoxes
        If fc = 1 Then sn(Replace(fc.Name, "Checkbox", "") - 1) = "X"
      Next
    
      With Sheet2.Cells(1).CurrentRegion
        For j = 0 To UBound(sn)
          .AutoFilter 2 + j, IIf(sn(j) = "X", "X", "<>X")
        Next
        .Copy Sheets("afdruk").Cells(1)
        .AutoFilter
      End With
    End Sub
    Attached Files Attached Files
    Last edited by snb; 01-19-2012 at 06:14 AM.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0