lundi 26 novembre 2018

Excel - Checkboxes, Sheet1 to select which rows you don't want, Sheet2 with unwanted rows hidden

First of all, I'm using Excel 2013.

Basically I want checkboxes to control which row is/isn't printed on my document.For exemple, I have 2 worksheets : EnterSheet and PrintSheet. PrintSheet is copied directly from EnterSheet. On EnterSheet, each rows have a checkbox that I would deactivate to hide the corresponding row in PrintSheet. The user can simply check which rows he wants in EnterSheet and print out PrintSheet that contains only what he needs.

I've uploaded a screenshot to showcase what I actually want from my Excel file : https://imgur.com/a/otorlaX EnterSheet is where the user select which rows he needs, then he just has to print PrintSheet to complete his work.

I know how to make the Checkboxes, and I have very basic knowledge on VBA and macros so I can surely set something up with some help. Something that I've thought I could maybe do is to add a column which contains the boolean value of the checkboxes, and have them associated with a macro that checks if it's true/false and unhide/hide the corresponding row on the PrintSheet, but I have no clue how to set that up and I have issues with relative references concerning different sheets. Would it be possible, as an exemple, to store the Checkbox's position in a variable and use this variable to select the same row in PrintSheet?

I'll add that I've tried using the Group (outline) feature. Unfortunately it almost matches my needs but not quite because you cannot group, let's say, row 3-4 and 5-6 separately, it will make a single group of 4 rows instead of 2 groups of 2 rows.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire