+ Reply to Thread
Results 1 to 9 of 9

Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tracker

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tracker

    Hi! I need a vba which highlights cell for numbers, I was hoping you could help me. Two options, either worksheet event or conditional formatting. Basically, at every drawn number user would input it to cell "C1", then an event (or vba) highlights the same from range "B3:P7", cell color (formatting) should be retained until I reset it thru a command button. What would be fancier (wishlist), is for number to be bigger (and/or bolder) ... e.g. when "B4" is drawn it sorts of outweighs others...

    Thanks in advance Excel gurus! Appreciate it...
    Last edited by jhoelski; 10-25-2017 at 08:28 PM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    try this, in the worksheet module:
    Please Login or Register  to view this content.
    Use procedure ResetBingo to reset the grid.
    Last edited by Olly; 10-19-2017 at 09:36 AM.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    Tried it and works beautifully. I've added data validation for the input to accept 1-75 only... how about a vba to avoid duplication (keying in the same number after it has been drawn already)? Also, if it is not too much to ask, can I have a code wherein after the "RESET" the drawn numbers are stored/ kept into a separate sheet for audit purposes? Again, thank you for the time and effort. Thanks in advance!
    Last edited by jhoelski; 10-20-2017 at 03:00 AM.

  4. #4
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    Hi! should I marked this as "SOLVED" and just post a new thread? can anyone else help? was wondering if array should work. thanks!

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    Here's amended code to log a list of drawn numbers, for each reset game. You'll need to add a worksheet, and change the sLogSheet variable name to suit. It also checks whether a value has already been drawn.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    thank you so much Olly for taking time out to assist me. question, the cfound and cdrawn toggles the format settings of the cell by triggering BGON and FONTON... what of I wanted to retain the format after clearing or accepting input at C1... what I mean is another formatting for example for "already" drawn numbers (cFOUND) say "FONTRetained" and "BGRetained" not the default black executed by the vba? another With statement? appreciate the help, i will try the code re logs and will let you know.... again my heartfelt gratitude.
    Last edited by jhoelski; 10-23-2017 at 10:51 AM.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    I don't understand what you want?

    There are 3 possibilities, when a number is "drawn" (entered in cell C3):

    Option 1: The Number is found in the bingo range, and has not already been drawn.
    In this case, the most recently drawn number is highlighted with font colour (iFontOn) and interior colour (iBGOn).
    All numbers which have preivously been drawn are highlighted with font colour (iFontOff) and interior colour (iBGOn).
    The most recently drawn number is added to the bottom of the most recent list of drawn numbers on the log worksheet.


    Option 2: The Number is found in the bingo range, and HAS already been drawn.
    In this case, no changes are made to the formatting of the bingo grid. The duplicate value is shown in the VBA immediate window.


    Option 3: The Number is NOT found in the bingo range
    In this case, no changes are made to the formatting of the bingo grid. The unfound value is shown in the VBA immediate window. The application beeps.


    I'm not clear what you want to change?

  8. #8
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    sorry for that Olly to illustrate e.g. "9" is drawn using the code it would be bg = red, font= yellow. I wanted to modify the code to change it as the after effect and choose another for currently or last drawn e.g. bg= red, font= white for whenever I try to modify the code range all fonts becomes white... what I meant was black for undrawn, yellow bg/ red font for previously drawn, red bg/ white font for "drawn" after user types it in (all of course subject to "reset") sorry for being choosy with the format and hope I am not being a nuisance to you... appreciate the help thank you so much

  9. #9
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Highlight Cell (Conditional Formatting or VBA Worksheet event) equals cell - BINGO tra

    It's OK Olly I know you're that busy... I've managed as a workaround instead to come up with a code to find interior color and change the font to the desired formatting it executes before the "drawing" procedure. Again, thanks for the help and kudos to this forum and the gurus here!

+ 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. Replies: 1
    Last Post: 01-24-2017, 10:27 AM
  2. Highlight a row if conditional formatting is used in cell
    By brucey2343 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 08-16-2013, 06:49 AM
  3. Replies: 7
    Last Post: 06-10-2013, 09:39 AM
  4. Conditional formatting - highlight range of cells when it equals a cell
    By kingkong321 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2012, 05:13 AM
  5. highlight a cell with conditional formatting
    By sp1974 in forum Excel General
    Replies: 0
    Last Post: 09-10-2011, 12:44 AM
  6. Replies: 3
    Last Post: 08-16-2011, 09:13 PM
  7. Conditional formatting-how to highlight a cell
    By jacold in forum Excel General
    Replies: 0
    Last Post: 01-14-2005, 08:10 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