
Excel macro to open files, change a cell and hide rows with zeros in range of columns
- or -
Post a project like this2667
$100
- Posted:
- Proposals: 3
- Remote
- #2135393
- Completed
Description
Experience Level: Expert
Estimated project duration: less than 1 week
We have a folder on our network with about 40 excel files that we need a macro to perform some operations on. The macro should be contained in its own excel file and it needs to access all folders at "S:\Month End Closing\F9\Live Production\Departmentals Beta\" and perform a series of operations:
In the VBA excel file have a cell to hold the Current Month which will be January, February...November,December and another cell for the current year and it should be this year based upon the current system date and the prior 2 years.
Then for in each file in the path - Change a cell named "CurrentMonth" to the value in the month cell in the VBA file and change the cell named "CurrentYear to the value in the year cell in the VBA file
Then recalculate the path file because it will be on manual recalculation setting. Once the recalculation is complete then we want to hide rows with zeros in certain columns. There are 3 visible sheets in the file and we have set up named ranges to help. For each of those 3 sheets we will want a row hide routine to run.
For range named "Reportarea_ytd" for only rows that have non empty cells in column I, hide all rows that have 0 value or are blank in columns D,E ,J and K. Otherwise the row should not be hidden. If cell in Column I is blank then that rows should not be hidden because it is an intended spacing row for cosmetic purposes.
For range named "Reportarea_actuals" for only rows that have non empty cells in column C, hide all rows that have 0 value or are blank in all columns E through O. Otherwise the row should not be hidden.
For range named "Reportarea_budget" for only rows that have non empty cells in column D, hide all rows that have 0 value or are blank in all columns E through P. Otherwise the row should not be hidden.
It is important that the manual recalculation be complete before the hide row commands begin as this can take over 30 seconds when file is open and not sure how long when file is closed because we have never tried it. The file includes an excel add in formula which pulls data from a database on our server when we recalculate the file. The file I will send you does not have the excel add in formula because you would only see error for values.
I have included 2 of the approximate 40 files that we wish the VBA to perform these operations on.
In the VBA excel file have a cell to hold the Current Month which will be January, February...November,December and another cell for the current year and it should be this year based upon the current system date and the prior 2 years.
Then for in each file in the path - Change a cell named "CurrentMonth" to the value in the month cell in the VBA file and change the cell named "CurrentYear to the value in the year cell in the VBA file
Then recalculate the path file because it will be on manual recalculation setting. Once the recalculation is complete then we want to hide rows with zeros in certain columns. There are 3 visible sheets in the file and we have set up named ranges to help. For each of those 3 sheets we will want a row hide routine to run.
For range named "Reportarea_ytd" for only rows that have non empty cells in column I, hide all rows that have 0 value or are blank in columns D,E ,J and K. Otherwise the row should not be hidden. If cell in Column I is blank then that rows should not be hidden because it is an intended spacing row for cosmetic purposes.
For range named "Reportarea_actuals" for only rows that have non empty cells in column C, hide all rows that have 0 value or are blank in all columns E through O. Otherwise the row should not be hidden.
For range named "Reportarea_budget" for only rows that have non empty cells in column D, hide all rows that have 0 value or are blank in all columns E through P. Otherwise the row should not be hidden.
It is important that the manual recalculation be complete before the hide row commands begin as this can take over 30 seconds when file is open and not sure how long when file is closed because we have never tried it. The file includes an excel add in formula which pulls data from a database on our server when we recalculate the file. The file I will send you does not have the excel add in formula because you would only see error for values.
I have included 2 of the approximate 40 files that we wish the VBA to perform these operations on.
David Z.
100% (8)Projects Completed
9
Freelancers worked with
7
Projects awarded
64%
Last project
22 Jan 2023
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies