Spreadsheet needs to replicate itself and hide set rows that contain a zero or nothing

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Could someone help me with a spreadsheet that I am having a heap of trouble with.

This spreadsheet to enter identifying information, such as child, worker, organisation. A start and a end date can then be entered for the service. Additional information can then be entered, such as start time. end time, work type and ratio.

Under that there is a table where daily expenses can be entered (D14:D17).

The second table then references a lot of hidden information in J2:V28 to give you some answers.

This all works for me but the problem I am having is with 2 of the buttons.
  1. The first button is "Add another period"
    1. This button is meant to copy the range A8:V32 and put it below on the start of a new page. This can be done x number of times, with each time, the range A8:V32 being copied and pasted to a new page below. Each new period on a new page needs to be a mirror image of the first, except for those extra two rows, Worker and Organisation.
    2. Obviously, I want the columns J:V to remain hidden. There is some hidden information at the start, rows(2:8) that are not copied down as they relate to the entire document and will not change.
    3. Each instance of these copies represents a different period and can be completely different, dates, prices etc.
    4. When a new period is created, the buttons and txtMain need to be moved down to below the bottom of the new period that has just been inserted.
At the moment, the Add another period button inserts a page break after the first expense table and I am not sure why.

2. The second button is "Save to pdf", is meant to look at all of the periods that have been inserted and it saves the document to pdf. The code needs to look at every table that has the expenses for the period and every table that has the totals. For each row that has a 0 or nothing in units column on either the totals tables or the expenses tables, that row needs to be hidden.

At the moment, it is rather random with the rows that it hides

I was trying to work this out myself and then my wife reminded me that I used to upload spreadsheets to this forum to get help so I have uploaded a copy of my spreadsheet to google drive and linked it below.

Thanks for your help guys.

 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,047
Messages
6,122,858
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top