+ Reply to Thread
Results 1 to 11 of 11

need the first line of each cell color line group

  1. #1
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    need the first line of each cell color line group

    Hello

    I want to get the first line of each set of white/gray colored lines (such as circled in the image)

    I couldn't think of any way of doing it but manually. Is there any way to automate this?

    Thank you for you attention!

    example.png

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: need the first line of each cell color line group

    Could you provide the actual sheet as the formatting is not clear from the image.

    It's nice to see a question involving the Gene ontology
    Martin

  3. #3
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    Re: need the first line of each cell color line group

    Quote Originally Posted by mrice View Post
    Could you provide the actual sheet as the formatting is not clear from the image.

    It's nice to see a question involving the Gene ontology
    of course, here is a sample table

    In that case, I'm looking for lines 3, 11, 20 and 38

    Oh, it's rare from what I have seem, I have met so many bioinformaticians who knew how to use R but used excel manually haha

  4. #4
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    Re: need the first line of each cell color line group

    forgot attachment
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-14-2018
    Location
    Vermont, USA
    MS-Off Ver
    Office 365
    Posts
    72

    Re: need the first line of each cell color line group

    I'm just going to slip my solution in before Martin returns with what I assume will be a better one. (I'm just trying to learn by experimenting with some of the easier issues out here.) The tricky part for me is identifying the shading. Interior.Color = 15724527 worked with my code. The macro just puts a border around each head-row, but in that spot, having identified the row, you can add any code you want to do what you need to with the rows.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jeff Ho; 05-28-2018 at 04:03 PM.

  6. #6
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    Re: need the first line of each cell color line group

    Jeff Ho,

    thank you very much! it works nicely, the only issue is that it encircles both elements in sets with 2 elements like pic (my bad for not posting more sets in the example sheet!)
    example2.png

    I will try to find a code that deletes elements with no border! thank you very much!
    Last edited by jeffreybrown; 05-28-2018 at 07:55 PM. Reason: Removed full quote!

  7. #7
    Registered User
    Join Date
    04-14-2018
    Location
    Vermont, USA
    MS-Off Ver
    Office 365
    Posts
    72

    Re: need the first line of each cell color line group

    Hmmm. Too bad the company just arrived, I can't check it now. But I'm very interested to find out why it's doing that. If I figure out how to correct it I'll re-post.

  8. #8
    Registered User
    Join Date
    04-14-2018
    Location
    Vermont, USA
    MS-Off Ver
    Office 365
    Posts
    72

    Re: need the first line of each cell color line group

    As it turns out, the company is late…

    I found a different error (“r” was confusing row # and offset), but I don’t think the macro is selecting both elements of a two-element set. It just looks like that because the rows are adjacent. When I change the border action to making the font red, it shows that only one row is indicated.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    Re: need the first line of each cell color line group

    Thank you! that worked like a charm!! Now I am currently trying to delete the rows with blue letters and getting my *** handed to me

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-14-2018
    Location
    Vermont, USA
    MS-Off Ver
    Office 365
    Posts
    72

    Re: need the first line of each cell color line group

    Sorry I can't be available to help you work through this right now, but the main thing is that it isn't as simple as naming a color. There are only a few color constants and they begin with "vb" (e.g. vbRed, vbBlack, etc.). Also, they apply to the Color property, not the ColorIndex property. (It's confusing!)

    In Module 1 add this:
    Please Login or Register  to view this content.
    Then select a cell with the blue color font and run the macro. I got ColorIndex 23, but do it yourself to be sure. Then use that index # to identify the blue font rows.

  11. #11
    Registered User
    Join Date
    02-22-2018
    Location
    Brazil
    MS-Off Ver
    1801
    Posts
    41

    Re: need the first line of each cell color line group

    Absolutely excellent! It worked perfectly, you have no idea how happy I am for not having to do that manually hahah

    Thanks Jeff and Mrice!

+ 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. Marker and Line Color Options in Excel Line Graph
    By Slmoore in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-21-2013, 12:55 PM
  2. Replies: 3
    Last Post: 08-28-2012, 09:16 AM
  3. Change color of line in line graph
    By ptk in forum Excel General
    Replies: 4
    Last Post: 11-17-2011, 07:57 AM
  4. Line chart group by color, one dashed on solid
    By pg300 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-02-2011, 05:15 AM
  5. Replies: 4
    Last Post: 07-05-2006, 11:10 AM
  6. excel 'begin a group' menu line color
    By acegap in forum Excel General
    Replies: 0
    Last Post: 04-23-2006, 11:35 AM
  7. Changing a line color when it crosses another benchmark line?
    By JB12 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-10-2005, 12:55 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