Looping and sorting through blocks of rows

zeekmcphee

New Member
Joined
Feb 27, 2018
Messages
25
Office Version
  1. 2016
Platform
  1. Windows
Hello
I am looking for a VBA solution
I have a sheet with several thousand rows.The rows are split up into blocks of rows and seperated by an empty row.Each block of rows will vary with entries so these are random

The sheet has 7 fields author,book_ title,publisher,year_published,genre,number,copies_sold.
The number field is a number against each book title within the block of rows

The last field..copies_sold is a numeric field and what I would like to do is sort each authors copies sold field from least sold to most sold.
If the sheet was one long continuous record then sorting would be easy,but it is a series of blocks of records for each author.
Is there a way that I could some how loop through each individual authors block and sort the copies sold field from smallest to largest;
Below is an example of just three authors,there are three blocks of rows of 4,6and7

author_name.. book_title..publisher..year_publishednumbergenrecopies_sold
molly brownswandolphin20141mystery26000
molly brownthe rockdolphin20132mystery18500
molly browndaytimedolphin20123thriller670500
molly brownlostgracey20064mystery78000
empty
empty
empty empty empty
empty
empty
ken daviessunshinegracey20081crime136000
ken daviesrocketgracey20062crime236000
ken davieslast one ingracey20073mystery900000
ken davieswaterfallbell20104mystery155000
ken daviesthe ringbell20165thriller257893
ken daviesaprilbell20176thriller823456
emptyempty
empty
empty
empty
empty
empty
dawn ellismrs jonesbell 20171bio289000
dawn ellisthe paradegracey20172bio456000
dawn elliscarnivalgracey20143thriller234000
dawn ellisvalleydolphin20124mystery980000
dawn ellismy treedolphin20105romance345000
dawn ellistalkdolphin20096romance650000
dawn ellissmilebell20037thriller345000

<tbody>
</tbody>

Hope this makes sense :)
ZM
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,216,207
Messages
6,129,508
Members
449,512
Latest member
Wabd

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