+ Reply to Thread
Results 1 to 3 of 3

Extract top 5 rows, not colored or greyed out

  1. #1
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    246

    Extract top 5 rows, not colored or greyed out

    Need to extract the top 5 rows from SHEET2 to put on SHEET1.
    Just extract the BOLD/BLACK fonted rows - not the BLUE/YELLOW and not the GREYED OUT

    This also needs to update as the list updates. The list will change a name to greyed out, so the top 5 will need to change without that name.

    see attached
    Attached Files Attached Files
    Last edited by x65140; 01-31-2020 at 01:16 PM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Extract top 5 rows, not colored or greyed out

    If I understood you correctly, paste the code into the normal VBA module and run it.
    PHP Code: 
    Sub NotBlueGrey_maras_mak()
        
    Dim rng As Rangecell_ As Range
        Dim i 
    As Integerii As Integer
        Dim a
    rws
        
        With Sheets
    ("Sheet2").[B3]
            
    Set rng = .CurrentRegion.Columns(1)
            
    = .CurrentRegion.Value
            ReDim rws
    (1 To UBound(a))
        
    End With
        
        
    For 1 To UBound(a)
            If 
    rng.Cells(i).Font.Color vbBlack Then
                ii 
    ii 1
                rws
    (ii) = rng.Cells(i).Row 2
                
    If ii 5 Then Exit For
            
    End If
        
    Next

        ReDim Preserve rws
    (1 To ii)
        
    With Sheets("Sheet1").[Q3]
            .
    CurrentRegion.ClearContents
            
    .Resize(ii4) = Application.Index(aApplication.Transpose(rws), Array(1234))
        
    End With
        Set rng 
    Nothing
    End Sub 
    Best Regards,
    Maras.

  3. #3
    Registered User
    Join Date
    11-21-2016
    Location
    Emmen, The Netherlands
    MS-Off Ver
    MS Office 365 ProPlus
    Posts
    19

    Re: Extract top 5 rows, not colored or greyed out

    Hope this helps:

    Please Login or Register  to view this content.

+ 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] Cannot Unhide Rows after hiding all below, Greyed out
    By alliancetechnology in forum Excel General
    Replies: 4
    Last Post: 12-17-2019, 01:03 PM
  2. How to count only colored cell and extract details of colored cell's row
    By bala04msw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-23-2016, 07:03 AM
  3. [SOLVED] Macro to extract Rows Colored with Yellow Fill and create a new sheet as per current month
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2016, 04:54 AM
  4. Help please - colored rows
    By CAP girl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2006, 04:30 PM
  5. unlock hidden rows when 'unhide' is greyed out?
    By xela in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2006, 10:25 PM
  6. Insert Rows option greyed out
    By Markus in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 12:00 AM
  7. sort according to the colored rows
    By swchee in forum Excel General
    Replies: 2
    Last Post: 08-18-2005, 12:05 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