Hi Folks,
I got some help from @ByteMarks on some code that would hide rows in various places in my spreadsheet depending on the value of a reference cell. My spreadsheet uses a main "Input" page to add information about a shipment of goods, and then a bunch of shipping documents are created (in other tabs) based on that information. The pages are then converted to PDF and sent to me via email. The code I'm trying to fix (that I obtained from this forum) hides rows in the other tabs where the shipping documents are created, with the express purpose of shortening the size of the document; ex: If I'm shipping 14x goods, there are 14 rows of data in these tabs; if I'm only shipping 2x goods, all rows but 2 are hidden to shorten the size of the PDF when it's printed.
Here is the code, and where in the code the error is happening when I try to run it in my spreadsheet:
There is also the following private sub function for the "Input" tab where I have my reference cell:
For reference, the reference cell I use is I21 (it was originally B2 when I attached the example spreadsheet for help with writing the code), which is where I enter the # of goods being shipped. I'm not sure what the "With Range(a(i)) refers to, though I'm guessing I need to adjust this in some way to allow it to work?
Bookmarks