Siddhart Nagwekar
New Member
Hi Readers,
First off, thanks for accepting me into the Chandoo community.
My problem arises from the fact that I run macros on a report where the columns keep changing places. I need a macro which can
Locate a particular column called PACE 1
Now the real problem is that the column headers are dynamic so the person preparing the report may insert new columns, delete columns or shuffle the location of the columns. The macro needs to ignore the location of the columns and function purely on the basis of the column headers.
I have attached an excel workbook with an example of all the above criteria that I have mentioned above.
I need another macro which is a slightly modified version of the first macro and is used in a second column PACE 2. The criteria for the first macro remain the same as in the first macro, however in the second macro, wherever column headers P or E are being inserted in column PACE 2 instead of the column headers I need the value P&E to be inserted.
In both the PACE 1 and PACE 2 columns, the formula needs to be inserted in every row for which there is a value in the 1st column of the table.
Any help will be greatly appreciated
First off, thanks for accepting me into the Chandoo community.
My problem arises from the fact that I run macros on a report where the columns keep changing places. I need a macro which can
Locate a particular column called PACE 1
- Insert a formula from the first row under the PACE 1 column
- The formula needs to be such that
- If there is a value (number) in any of the columns i.e. P, A, C Or E, it inserts the column header into the corresponding row under the PACE 1 column
- If there are values in two or more columns of the 4 columns, it needs to consider the highest value and insert the respective column header in the corresponding row in the PACE 1 column
- If there is a zero in one of the four columns i.e. P,A,C, Or E, it needs to insert the respective column header in the corresponding row in the PACE 1 column
Now the real problem is that the column headers are dynamic so the person preparing the report may insert new columns, delete columns or shuffle the location of the columns. The macro needs to ignore the location of the columns and function purely on the basis of the column headers.
I have attached an excel workbook with an example of all the above criteria that I have mentioned above.
I need another macro which is a slightly modified version of the first macro and is used in a second column PACE 2. The criteria for the first macro remain the same as in the first macro, however in the second macro, wherever column headers P or E are being inserted in column PACE 2 instead of the column headers I need the value P&E to be inserted.
In both the PACE 1 and PACE 2 columns, the formula needs to be inserted in every row for which there is a value in the 1st column of the table.
Any help will be greatly appreciated