+ Reply to Thread
Results 1 to 3 of 3

Variable column range, based on current selection, for sorting columns

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2003
    Posts
    3

    Variable column range, based on current selection, for sorting columns

    I've been searching for hours and can't figure out how to change this coding to do what I need it to.

    The first line of the code chooses the columns to select; all columns until there is no value. From there I need to have it sort those columns based on row 1. The problem is that the columns chosen are variable. It could be columns I:N (as shown below) or column G:Z or any other combination. (The code below was recorded if that matters at all.)

    Please Login or Register  to view this content.
    Also, ideally, I would not need to name the sheet as I would like this code to be useable on the current active sheet. Any assistance is very much appreciated.

    Thanks in advance,
    Kim

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Variable column range, based on current selection, for sorting columns

    This sorts from the ActiveCell column to the last used column if that's what your asking.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Variable column range, based on current selection, for sorting columns

    Fantastic! Exactly what I needed. Thank you!

+ 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] Sorting Column with a variable range
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2013, 03:13 PM
  2. Replies: 2
    Last Post: 10-07-2013, 11:06 AM
  3. [SOLVED] Return a variable based on a selection between dates and times in a range
    By Mr. H2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2013, 10:22 AM
  4. [SOLVED] Sorting rows of data based off a single column for a variable number of entries.
    By soxcrates in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2012, 12:31 PM
  5. Multiplying multiple columns based on current column
    By themachine in forum Excel General
    Replies: 3
    Last Post: 06-28-2010, 07:49 AM

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