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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,215,514
Messages
6,125,273
Members
449,220
Latest member
Excel Master

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