VBA copy / paste values based on header title

  • Hi there - am very new to VBA and am trying to create a macro that copies from one column and pastes it in another, based on the column header title.

    In Sheet 1 I have a bunch of dynamic data, in Sheet 2 I have several columns. Those with "New data" headers are directly linked to cells in Sheet 1. And I want to compare Old vs New whenever I refresh data in Sheet 1, so I'd like to create a macro that copies the cells under any column named "New Data" in Sheet 2 and pastes the values directly to the right of it to the column named "Old Data." Any help greatly appreciated here ! Thank you so much!!

    New DataOld DataNew DataOld DataNew DataOld Data
    Formula 1Paste Value 1Formula 5Paste Value 5Formula 9Paste Value 9
    Formula 2Paste Value 2
    Formula 3Paste Value 3
    Formula 4Paste Value 4

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!