Macro to Move Data with name to another sheet if name is moved

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
Hello all I have a Master Sheet that has Names in column A and each Name has its own Sheet and Data ex:

[TABLE="width: 100"]
<tbody>[TR]
[TD]A1[/TD]
[TD]BOB[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]JOHN[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]PETER[/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]SMITH[/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]LIZ[/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]TOM[/TD]
[/TR]
</tbody>[/TABLE]

I have A sheet named "1" in B1= BOB, Sheet named "2" B1= JOHN, Sheet named "3" B1= PETER
Sheet named "4" B1= SMITH etc... with B1 of each sheet link to the rows in Master sheet so if JOHN is moved from A2 to A4 in master sheet than the B1 in sheet named "4" has JOHN. what I need is a macro that will move JOHN data in column A in Sheet named "2" to column A in sheet named "4". In other words I need the data from each sheet to move with the Name. Usually a name will be moved down when new names are added therefore

[TABLE="width: 100"]
<tbody>[TR]
[TD]A1[/TD]
[TD]BOB[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]BETH[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]KIM[/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]JOHN[/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]PETER[/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]SMITH[/TD]
[/TR]
[TR]
[TD]A7[/TD]
[TD]LIZ[/TD]
[/TR]
[TR]
[TD]A8[/TD]
[TD]TOM[/TD]
[/TR]
</tbody>[/TABLE]

Or the other scenario can be that a name is removed and that the names below will be moved back up. so the data with each header needs to move when the Names move to different sheets.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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