+ Reply to Thread
Results 1 to 4 of 4

Highlight Rows Yellow

Hybrid View

jo15765 Highlight Rows Yellow 01-11-2023, 11:52 AM
rollis13 Re: Highlight Rows Yellow 01-11-2023, 12:20 PM
jo15765 Re: Highlight Rows Yellow 01-11-2023, 12:27 PM
rollis13 Re: Highlight Rows Yellow 01-11-2023, 12:36 PM
  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Highlight Rows Yellow

    I have a workbook that has data from column A - column BB

    In Column F we have a userid column
    I want to
    1) sort the workbook by column F ascending
    2) every other userid I want to highlight the row yellow - so leave 1st user id white, when user id changes highlight yellow, when user id changes again leave white, when userid changes again highlight row yellow

    Kinda like the Table Design but I only see a way to do every other row, I don't see a way to do each time the userid changes.

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: Highlight Rows Yellow

    Is something like this what you are after ? I didn't consider sorting since you can do that with the Macro Recoder and then intergrate it.
    Option Explicit
    Sub ColorRowsByID()
        Dim firstRow  As Long
        Dim IColor As Long
        Dim first  As Variant
        Dim second As Variant
        Application.ScreenUpdating = False
        firstRow = 2
        IColor = 6
        Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
        Do While Cells(firstRow, "F") <> ""
            first = Cells(firstRow, "F").Value
            second = Cells(firstRow, "F").Offset(1, 0).Value
            If second = first Then
                Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
            Else
                Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
                If IColor = 6 Then IColor = xlNone Else IColor = 6
            End If
            firstRow = firstRow + 1
        Loop
        Application.ScreenUpdating = True
    End Sub

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Highlight Rows Yellow

    @rollis13 - yes that highlights as I needed, thank you

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: Highlight Rows Yellow

    Thanks for the positive feedback, glad having been of some help.

+ 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. Text Highlight yellow
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2020, 06:51 PM
  2. if data deleted highlight in yellow
    By dd8 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2020, 01:09 AM
  3. [SOLVED] Highlight yellow on stock gaps
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-07-2015, 08:00 PM
  4. [SOLVED] Find number and highlight in yellow
    By Jerry HKA in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-10-2014, 04:17 AM
  5. [SOLVED] find last empty cell and highlight yellow
    By James__S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2014, 03:46 PM
  6. [SOLVED] Highlight Yellow Active Row, PROBLEM: row selected before closing stays yellow
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2013, 07:01 PM
  7. Highlight blank cells in yellow.
    By n_lindsey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2013, 02:17 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