Creating buttons to displaying pages and hiding the blank cells based on condition.

Iron Contributor

I have the attached file which represents the record of students' degrees based on their class (Excel 365). The student name column is variable depending on the selected class (C13). The rows (1-13) are set to print as titles for each page. I have created four buttons but have not assigned them as macros yet because I do know the code should be placed in each one. The required scenario is organized into two parts as below:
Part 1:
if the selecting class: First
when clicking on the page 1 button or clicking on the All Pages button, the rows (1-42) should appear in addition to rows (142,143,144). while others rows (Blank Cells) should be disappeared.
when clicking on page 2 or page 3 buttons only rows (1-13) should appear nothing else.

if selecting class: Second
when clicking on the page 1 button, the rows (1-53) should appear.
when clicking on the page 2 button, the rows (54-107) should appear. in addition to the rows which are set as the page titles.
when clicking on the page 3 button, the rows (108-136) should appear in addition to rows (142,143,144) and rows that are set as the page title. while other rows (Blank Cells) disappeared.
when clicking on the All Pages button, the rows (1-136) should appear in addition to rows (142,143,144). while other rows (Blank Cells) disappeared. The rows (1-13)should also appear on each page.

if selecting class: Third
when clicking on the page 1 button, the rows (1-53) should appear.
when clicking on the page 2 button, the rows (54-76) should appear. in addition to rows (142,143,144) and rows that are set as the page titles. while other rows (Blank Cells) disappeared.
when clicking on the page 3 button, only rows (1-13) should appear nothing else.
when clicking on the All Pages button, the rows (1-136) should appear in addition to rows (142,143,144). while other rows (Blank Cells) disappeared. The rows (1-13)should also appear on each page.

Part 2:
When clicking on the print button, only the page or pages which are displayed by buttons (Page 1, Page2, Page 3, All Pages) is/are printed. The print button should replace the procedure of going to File>>Print in excel file and print the page print area described in part 1.

Note: The attached file is not saved as “enabled macros”.

Hope anyone helps me to achieve this scenario and many thanks in advance for your help. Hope my explanation is clear.
Regards

0 Replies