Hello all,
Trying to write a macro that will move and delete info within rows based on certain criteria.
In the Title column (marked in the row 1 header), if there are two titles that match and are sequential, the following happens:
- On the row containing the first instance of the duplicate title, the dates in the HB Start Date and HB End Date columns are moved into the Start Date and End Date columns (replace any existing data in these cells). The data in the Hdate and Gdate columns in this row is deleted.
- On the row below this (containing the second instance of the duplicate title), delete the Gdate, HB Start Date, HB End Date, and Hdate data in this row.
In the example attached, Title2 is a duplicate, so the macro will move the data in the two rows for Title2:
Would need to loop through several thousand rows. The columns are not always in the same column letters, which is why I’d like to use the header in row 1 to identify the columns. Also, there may be instances of triple titles that match. In this case, do nothing – the macro should only move dates if it finds only two sequential titles. If there are more than this in the Title column, then do nothing.
Please let me know if there are any questions. Help is most appreciated on this – thank you!
Question also posed at Mr. Excel: http://www.mrexcel.com/forum/showthread.php?t=535105
Bookmarks