Chain Copy/Pasting data between sheets (w to x, x to y, y to z and z to y, y to x, x to w...)

s4lt25

New Member
Joined
Jul 29, 2014
Messages
4
Hey everyone,

What's given:
I am working with an excel folder with an overview sheet with several columns and 40 rows. The cells of each row is in turn retrieving and manipulating data from a corresponding separate sheet labeled 1 through 40.
The manipulation done by each row with the corresponding data from the respective sheet is essentially the same (and so is the format of the 'feeder' sheets), whats different is the data fed from the corresponding sheets.

Problem:
I sometimes have to shift rows within the overview sheet. In order to preserve the formatting and not having to retype/adapt each formula, I would have to manually copy paste the data contained within sheets 1-40.
So for example row 40 is empty, and I want to insert a row at row 15. Currently I would cut/paste starting with sheet 39 to 40, then 38 to 39 and so on, until sheet 15 remains blank and ready for data input.
The same applies for removing a certain data point and shifting everything upwards, for example I want to remove the data in row 15 and shift everything up. In this case (assuming 40 filled rows) I would cut/paste from sheet 16 to sheet 15, then from sheet 17 to sheet 16 and so on, until sheet 40 is empty.
Thats a lot of manual labor, and I'd be grateful if someone here could help me create a macro to simplify things. I can shortcut this by creating new sheets and then manually inserting a new row in the overview sheet which I would then format myself. But I need this to work for people who are unfamiliar with any sort of data manipulation in excel other than entering data in cells.

Solution:
A setup which, upon click of a command button (active x control element) activates a macro which does two things:
First, it checks a cell for its value (integer x [-41<x<40, x not 0]);
Second, it cut pastes the sheet content from sheets 1-40 according to this value.
- For values -40 to -1 the data of the corresponding sheet (-30 equals sheet 30) is replaced with the next sheet's data (so in this case the data from sheet 31 is cut/paste to sheet 30, ..., until sheet 40 has been cleared, thus effectively shifting all data in the overview sheet one row upwards);
- For values 1-39 the data of the corresponding sheet is cut/paste to the next sheet. In order to not lose the information of the receiving sheet, the data of sheet 39 is cut/paste to sheet 40, then 38 to 39 and so on, until the required sheet has been copy pasted, thus effectively shifting all data downwards, and creating a new, empty row at the desired place.

Notes:
My solution is based upon how I think this problem could be solved in a user-friendly fashion. I welcome any other solution out there which has the same effect (shifting the data within my overview sheet up/downwards with the click of a button/execution of a macro at the desired point).

Apologies for this lengthy post - I don't expect a fully fledged out answer, but any outline of how the macro should be structured [I never programmed one] and how to do this based in a simplified setup with 3 sheets would be amazing!

I would be extremely grateful for any and all help you can provide me with.

Sincerely, Salomon
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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