sparky2205
Well-known Member
- Joined
- Feb 6, 2013
- Messages
- 507
- Office Version
- 365
- 2016
- Platform
- Windows
Hi folks,
this is a link to a spreadsheet: WeTransfer File.xlsm
It contains 2 worksheets.
"General Usage" is where the users enter their information.
"Print Data" is a copy of "General Usage" but with conditional formatting that only displays the relevant data. i.e. it doesn't display nonrelevant n/a. Some n/a are relevant and are displayed. If you look at "Print Data" you will see this. This is achieved by hiding data and borders as appropriate. All is well to this point.
When the user has entered all their data they then print the form using the "Print" button.
The macro behind the "Print" button collapses any nonrelevant rows in "Print Data"; ".EntireRow.Hidden = True". This works fine unless the last row is hidden. If the last row is hidden "Print Data" doesn't display the border on the last row of data when printed. It will show as present on "Print Data" but when the rows are collapsed by the macro the bottom border is not visible.
I think I know why this is happening. My CF formula removes the bottom border from the last row which, when collapsed, overrides the CF on the last row of the previous section. But that may not be correct.
I have tried several variations e.g. including "and the previous section <> n/a" in the CF formula but I still get the same result. That bottom border is missing every time.
Note: Running the macro will hide "Print Data" and protect the workbook but the password is an empty string.
Any help is greatly appreciated.
this is a link to a spreadsheet: WeTransfer File.xlsm
It contains 2 worksheets.
"General Usage" is where the users enter their information.
"Print Data" is a copy of "General Usage" but with conditional formatting that only displays the relevant data. i.e. it doesn't display nonrelevant n/a. Some n/a are relevant and are displayed. If you look at "Print Data" you will see this. This is achieved by hiding data and borders as appropriate. All is well to this point.
When the user has entered all their data they then print the form using the "Print" button.
The macro behind the "Print" button collapses any nonrelevant rows in "Print Data"; ".EntireRow.Hidden = True". This works fine unless the last row is hidden. If the last row is hidden "Print Data" doesn't display the border on the last row of data when printed. It will show as present on "Print Data" but when the rows are collapsed by the macro the bottom border is not visible.
I think I know why this is happening. My CF formula removes the bottom border from the last row which, when collapsed, overrides the CF on the last row of the previous section. But that may not be correct.
I have tried several variations e.g. including "and the previous section <> n/a" in the CF formula but I still get the same result. That bottom border is missing every time.
Note: Running the macro will hide "Print Data" and protect the workbook but the password is an empty string.
Any help is greatly appreciated.