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,019
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.

 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,019
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Could someone help me with this please?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,632
Messages
5,597,287
Members
414,134
Latest member
Tiyas44

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
Top