Hello everyone! and thank you for your time.
I work as a financial analyst and I have a VBA question. I would appreciate if you can help me.
My goal is for excel to hide automatically certain columns depending on the imputs on two cells, which indicate the YEAR and MONTH desired. I want the DAY to always be the last possible day of the month.
I have google this, and the best solution I have found is:
This code works great, but I have two issues. The first one is that it feeds the code with the date in the cell O3 rather than getting the year and month from P5 & P6. To solve this, I have used this formula on the cell O3 =DATE(P5;P6+1;0). The problem I am having now is that when I change either the year or month the colums wont hide until I click on O3 and press enter. I guess the code above requires you to interact with that cell specifically. Changing the value doesn't trigger the code.Please Login or Register to view this content.
The second issue, a minor one, is that I want the month and year imput to be on a different sheet. As this cells are going to be linked to a bunch of sheets.
Can you guys please help me with this? I tried googling it but can't find a solution.
Thank you in advance.
EDIT: I have posted this on another website. Didnt know it was against the rules. The reason I am posting here now is because I couldn't upload a file on the other forum. Thank you.
Bookmarks