Hi Guy's I am looking for a little bit of help if possible.
I have a worksheet that contain numerous columns of data that has been imported from other worksheets.
The columns start at column B and repeat every 3 columns. The number of columns can vary per worksheet.
The number of rows can also vary within the blocks of 3 columns. (e.g. columns B,C D may have 20 rows. columns E,F,G may have 27 rows etc.)
I have managed to sort the first 3 columns using the code below, but can not work out how to loop through to the next 3 columns and so on until the last column.
I would welcome any help and advice.
Many thanks
Andy
I have a worksheet that contain numerous columns of data that has been imported from other worksheets.
The columns start at column B and repeat every 3 columns. The number of columns can vary per worksheet.
The number of rows can also vary within the blocks of 3 columns. (e.g. columns B,C D may have 20 rows. columns E,F,G may have 27 rows etc.)
I have managed to sort the first 3 columns using the code below, but can not work out how to loop through to the next 3 columns and so on until the last column.
Code:
Sub sort1()
Range("B21", Range("D" & Rows.Count).End(xlUp).Address).sort Key1:=[b21], _
Order1:=xlAscending, Header:=xlYes
End Sub
I would welcome any help and advice.
Many thanks
Andy