Sort two ranges in same column VBA

mbpress01

New Member
Joined
Dec 30, 2017
Messages
20
Hello and thanks in advance. I am trying to figure a way to sort two separate ranges in the same column with one row between the first range and second. There is no headings and its a simple sort (alphabetical). I thought about using LastRow variable, determining the last row, current region and sort, then using offset to get to the first range and perform the sort. Any help would be much appreciated. thx
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Code:
Dim area As Range
For Each area In Range([A1], Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlCellTypeConstants).Areas
    area.Sort Key1:=area(1), Order1:=xlAscending, Header:=xlNo
Next
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,170
Members
449,296
Latest member
tinneytwin

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