+ Reply to Thread
Results 1 to 6 of 6

sort columns for a number of cycles

  1. #1
    Registered User
    Join Date
    10-19-2014
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    3

    sort columns for a number of cycles

    Hey everyone, I'm a little new to VBA and I got a quick question.
    I'm sorting columns a-c from row 1-26 based on column a, from a-z. I'm trying to repeat this for columns d-f, g-i, j-l, etc..
    Here's my code so far, there's a problem with it though and I was hoping someone could help me out.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-19-2014 at 02:54 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sort columns for a number of cycles

    Hi,

    What exactly is the problem you encounter? Are you getting a VBA error message or just not getting the results you expect?

    But perhaps a more fundamental question, what's the point of sorting different columns as the loop processes. Why not just sort on the 12th column?
    Your error though is no doubt associated with code like

    Please Login or Register  to view this content.
    What is this trying to do?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-19-2014
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: sort columns for a number of cycles

    so i'm trying to select a1:c26 and sort it by column a. then i want to to jump 3 columns over and select d1:f26 and sort by column d. so on and so forth.
    Untitled.jpg

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: sort columns for a number of cycles

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    10-19-2014
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: sort columns for a number of cycles

    Wow that's awesome thanks, works perfectly.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: sort columns for a number of cycles

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Rearrange(sort) Columns based on number in Column header string.
    By hifliers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 01:36 AM
  2. [SOLVED] Need help sorting data in columns that will sort by number of Xs
    By brenna.at.work in forum Excel General
    Replies: 7
    Last Post: 04-03-2014, 07:17 PM
  3. Sort unknown number of columns by row 1
    By rwqiii in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-27-2011, 04:42 PM
  4. Limited number of sort columns
    By dockdude in forum Excel General
    Replies: 3
    Last Post: 12-06-2010, 10:55 PM
  5. Sort - max number of columns?
    By KarenF in forum Excel General
    Replies: 4
    Last Post: 07-29-2005, 09:05 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