+ 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
    50

    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 2021 (Windows)
    Posts
    7,902

    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
    50

    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 2021 (Windows)
    Posts
    7,902

    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)

Similar Threads

  1. [SOLVED] Highlight random cells within a table
    By Rob Wood in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-16-2020, 02:03 PM
  2. Replies: 6
    Last Post: 08-07-2018, 09:25 AM
  3. [SOLVED] Highlight Duplicates in random order
    By vlady in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-13-2017, 01:36 AM
  4. *Random Highlight Macro Please Help*
    By kennonp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-20-2017, 03:52 PM
  5. Highlight Subtotaled Random Cell
    By Josh T. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 10:46 AM
  6. how to highlight same random number in a row
    By evan20002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2012, 12:12 AM
  7. [SOLVED] How Excel 2003 Highlight random cells and running tally appear?
    By PULIDOC in forum Excel General
    Replies: 1
    Last Post: 04-27-2006, 07:35 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