Move all data from selected rows, into the top most selected row.

Travis Kunnen

New Member
Joined
Feb 24, 2016
Messages
21
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All

Another problem.

Im seeking a function or macro to move all the data from a selected series of rows, into the top most row of the selected area.
Example below. There are 12 rows of Romboutsia (84 to 95), and all rows will (/should) have 1 data point. Im looking to move all the data from the selected rows, into the top most row for this group. So the data from C87, needs to move into C84, D90 into D84, E93 into E84, etc etc...
There will never be two sets of data in the rows, for the same selected grouping of names from column A.
Then I can repeat the process for the next set, the Ruminococcus, and so on and so forth....

Macro Top 20.xlsm
ABCDEFGHIJKLM
84Romboutsia0,0872162
85Romboutsia0,02813
86Romboutsia0,03553
87Romboutsia0,077430923
88Romboutsia0,21361
89Romboutsia0,11849
90Romboutsia0,047901507
91Romboutsia0,032
92Romboutsia0,01558
93Romboutsia0,02124862
94Romboutsia0,02868
95Romboutsia0,0124
96Ruminococcus0,01897662
97Ruminococcus0,014345097
98Ruminococcus0,014001448
99Ruminococcus0,0106
Layer 1
 
Your image post looks correct.

I dont follow your question.
Column A has only bacterial genus names, that are either as single names for 1 row of data, or multiple rows (of the same genus) for multiple rows of data from different sample types and locations for where they were identified.
So Column A is always genus name, and then the numerical data always starts in column B till G, or H, etc. But here its only 8 columns of numerical data.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You have a quantity of names of which some are repeated. Are these repeated same names all in a single block, are they under one another without any other names in this block of names?
For instance if you have AAA as a name and it is repeated 4 times so you'd have Cells A10, A11, A12, A13 and A14 all with AAA. Would AAA show up later again like in A16 or A24?

You might find out if you sort on Column A and run the macro again.
 
Last edited:
Upvote 0
Ah, I see what you're asking.
Yes, they do show up randomly throughout the database, but I do sort them alphabetically in my data file before I do any work on them or run a macro on them.
I will run yours again tomorrow to double check.
 
Upvote 0
i can tweet my code for you.

if i understand.
1. sort the list by column A so all the Genus are in order.
2. move all data for the first row of each Genus (this already works)
3. delete the remained rows within that genus, leaveing only one row per Genus.
-Ross
 
Upvote 0
Re: "Yes, they do show up randomly throughout the database"
OK, but that did not show in your original Post and that's what I went by.
If there are no 2 entries in one Column for one name, the code should work after sorting Column A
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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