+ Reply to Thread
Results 1 to 4 of 4

Highlight random cells

  1. #1
    Registered User
    Join Date
    05-19-2009
    Location
    WA, USA
    MS-Off Ver
    Excel 2010 and Office 365
    Posts
    43

    Highlight random cells

    Hi, all!!!

    I'm trying to get a macro to do a yellow highlight of two specific cells in a row, then search down to the next cell with data in it and highlight two cells in that row. I'd like it to do this all the way down until it doesn't find any more data in a cell when it searches down.

    Looking at all of the examples on Microsoft's Excel website regarding this, it only give examples of exact cells to use for your highlight. I mean, you tell it what specific cells to start and stop on. That works fine for my first two cells to highlight, but the next two (and any beyond that) are in the same columns, but not at exact cell locations. There could be two rows between occurrences, 10 rows, 40 rows. Who knows? The first two highlights always start in the same cells, but this spreadsheet is NEVER the same from week-to-week other than that.

    The macro I recorded highlights the first two cells just fine. But the search down for the next cell with data in it is not always at G11:H11 as the macro shows. So this will usually highlights blank cells.

    I guess it's easier to show what I would like to happen. What I've attached would not be in the same spreadsheet. I've included the "clean sheet" at the top, and the results I'm trying to get below. So this spreadsheet would really only go down to row 25.

    I'm trying to figure this VBA stuff out, but it's not all that easy. Every programming language always has its own terminology.

    If anyone can help, I'd greatly appreciate it.

    Thanks in advance.

    Steve
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,873

    Re: Highlight random cells

    You can do this with conditional formatting and no macro's, the only one I'm missing is the cells with a non-numeric input
    Attached Files Attached Files
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    05-19-2009
    Location
    WA, USA
    MS-Off Ver
    Excel 2010 and Office 365
    Posts
    43

    Re: Highlight random cells

    Hmmm. That looked simple enough. I've never used conditional formatting. Now I need to read up on that.

    Thanks, Keebellah.

    ...time passes...

    I think I found a way around that. I'm using the "Cell does not contain a blank value" option.

    Thanks again for the suggestion.
    Last edited by Styler001; 05-23-2020 at 01:01 PM.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,873

    Re: Highlight random cells

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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