VBA copy / paste values based on header title

rocketpower2022

New Member
Joined
May 11, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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 9 Paste Value 9
Formula 2Paste Value 2
Formula 3Paste Value 3
Formula 4Paste Value 4
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top