+ Reply to Thread
Results 1 to 2 of 2

Sorting a range based on a a column and filtering that column?

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Sorting a range based on a a column and filtering that column?

    HELLO ALL, Can someone tell me how to write the following in VBA?

    I have data in a range, lets say it is range A10:Y90
    Note that row 9 includes headers to the data does begin on row 10.

    I want to sort the range by the values in column C.


    Secondly, be abkle to filer only those rows where column C >= the value 50.


    Thanks in advance

    Lucy

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

    Re: Sorting a range based on a a column and filtering that column?

    You could record those steps and you'll have the VBA code.
    • Start recording
    • Select A9:Y90 (include the headers)
    • Select from the menu Data\Sort
      • Sort on column C
      • Okay
    • Select Data\Filter\Autofilter
    • Autofilter on column C
      • Custom >=50
    • Stop Recording
    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.

+ 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] Variable column range, based on current selection, for sorting columns
    By kshelmidine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2014, 11:46 AM
  2. [SOLVED] Need help filtering data by filtering based on the last digit of a column/true statement
    By Stephen R in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2014, 07:43 AM
  3. filtering date column based on the range
    By kmksprasad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2012, 05:04 PM
  4. Replies: 2
    Last Post: 11-28-2011, 06:10 PM
  5. Sorting based on the first column of a defined name range (Unknown)
    By PCLIVE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2005, 12:05 PM

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