Good evening,

I hope someone can help me with this as it's got be stumped.

I have one large spreadsheet, which several rows of data for each well, and there are 350 wells (so thousands of rows). Column A contains the well names, Column D contains codes which I will be using in another piece of software. And Columns B and C are From and To, respectively, which increase in depth. An example is below:

BHID FROM TO NLITH-New
BH-1 4 18.55 4
BH-1 18.55 116.09 9
BH-1 117.2 117.84 6
BH-1 116.09 117.2 10
BH-1 125.27 126.04 5
BH-1 117.84 125.27 11
BH-1 126.04 129.68 21
BH-1 129.68 133.72 19
BH-1 133.72 138.15 12
BH-1 138.15 145.55 20
BH-1 145.55 153.77 13
BH-1 153.77 160.53 6
BH-1 160.53 161.18 14
BH-1 161.18 162 22

Using VBA, I've both seperated out the worksheet into seperated worksheets, by well name, and then saved these worksheets as seperate text files (tab delimited). So I have a master worksheet and then individual ones for each well.

In order for me to load these files into my software, the data in both Columns B and C needs to be ascending. However, I've just noticed that, as highlighted in red for well BH-1 shown above, there are some rows mixed around for each well. This is very annoying and is the case for all the wells!

I would like to know if I can, using a VBA, sort the data in columns B and C into ascending order? I'm not sure if I can do this in the very large spreadsheet, as it would need to apply to each column but for each well at a time rather than the whole column at once. Maybe this will be easier across the individual spreadsheets?

I apologise if this sounds a bit complicated. Happy to provide some clarity!

Many thanks in advance.

Georgina