Results 1 to 8 of 8

Sort columns B,C,D based on column B then loop to next 3 columns and repeat till last colu

Threaded View

  1. #1
    Registered User
    Join Date
    03-20-2017
    Location
    Lancashire, England
    MS-Off Ver
    2010
    Posts
    40

    Sort columns B,C,D based on column B then loop to next 3 columns and repeat till last colu

    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.

    
    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.

    Sorry for cross posting but still new at this, please cross find post here
    https://www.mrexcel.com/forum/excel-...ml#post4798951

    Many thanks
    Andy
    Last edited by Andy15; 04-09-2017 at 05:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sort multiple columns by one column until BLANK, then REPEAT
    By Tamichan5 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2017, 09:06 PM
  2. [SOLVED] sort columns based on another column
    By kuntalnr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2015, 06:41 PM
  3. Help with Macro: I need to fill columns D-N only up till the row number in column A
    By zizou0178 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2014, 02:16 PM
  4. Copy entire selected column to next columns till last column
    By siroos12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2013, 05:20 AM
  5. [SOLVED] VBA SUMIF Loop - Repeat for multiple columns
    By SimonJF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2013, 12:12 AM
  6. [SOLVED] Sort multiple columns based on column header
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 01-09-2013, 09:55 AM
  7. Delete every alternate columns till the last data in the row from column G
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2012, 11:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1