+ Reply to Thread
Results 1 to 5 of 5

can i sort rows by colour?

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    england
    Posts
    40

    can i sort rows by colour?

    going through a large section of data and want to select the highlighted rows and transfer them to a new sheet preferably. Have highlighted these rows green if that matters, also have a few rows red, some yellow and some with no filled background colour. I need the entire rows to move - any ideas?

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Does this link help?

    http://www.bettersolutions.com/excel...O520032321.htm
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    09-29-2008
    Location
    england
    Posts
    40
    Quote Originally Posted by oldchippy View Post
    Okay I have never used this VBA code before and it is not working for me!

    It is exactly what I want to do, but can't get mine to work. The column I want to sort goes from G2:G1078, which are green, red or blank. Tried copying the text exactly (changing "c3" to "g2") and it doesn't work. What am I doing wrong?

    Thanks in advance

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Here's a link on where the code should go, follow these steps but paste in the code from the previous link

    http://www.wikihow.com/Create-a-User...icrosoft-Excel

  5. #5
    Registered User
    Join Date
    09-29-2008
    Location
    england
    Posts
    40

    still can't get it

    Range("B1").Interior.ColorIndex
    Range("B1").Font.ColorIndex

    Option Explicit

    Public Function ColourSorting(ByVal rgeCell As Range, _
    ByVal bBackGround As Boolean, _
    ByVal bText As Boolean) As Integer

    If bBackGround = True Then ColourSorting = rgeCell.Interior.ColorIndex
    If bText = True Then ColourSorting = rgeCell.Font.ColorIndex
    If ColourSorting < 1 Then ColourSorting = 0
    End Function

    This is what I have, do I pu in anything before,after to make it run? When I put it in a macro it comes up with "compile error: Invalid outside procedure", and it highlights my range. What do I need to do?

+ 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. using macro to sort 100 000 rows
    By martinlall in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 09-23-2008, 09:57 AM
  2. Need help for macro to automatically sort every 5 rows
    By excelbeginner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2008, 03:27 PM
  3. Sort Groups of Rows
    By slide in forum Excel General
    Replies: 2
    Last Post: 04-02-2008, 04:58 PM
  4. Sort Rows With Linked Textboxes
    By Lord Raiden in forum Excel General
    Replies: 7
    Last Post: 01-10-2008, 04:21 PM
  5. Sort Rows by Colour
    By rainbowtelecom in forum Excel General
    Replies: 3
    Last Post: 08-13-2007, 11:39 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