+ Reply to Thread
Results 1 to 4 of 4

Populate a defined number of blank cells in a column with "yes"

  1. #1
    Registered User
    Join Date
    05-16-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2013
    Posts
    2

    Populate a defined number of blank cells in a column with "yes"

    I'm making a board game in Excel where there are two players. Each player is allocated 6 cards that they may potentially draw from, but do not necessarily have to reveal all.
    Cards not revealed will be first in line for the next round. Cards that have been revealed/used are taken out of the game.
    helpmepls.PNG
    In the example here, cells D2:D4 and D8:D10 represent cards revealed in the past round.
    For this round, the first 6 cards with empty values in the used? column should be allocated to player1. The next 6 cards with empty values in used? should be allocated to player 2. These values are represented in the table in column K:M

    I have already written the code to generate the 12 values in the table in column K:M as the first 12 cards in the list that have not been used. I am now stuck on the step before this: Let's say in the current round, player1 reveals 3 cards and player2 reveals 2 cards. I have a cell for each player that, at the end of each round, displays the number of cards they drew.This means that the first three cards in the table should be marked as used by player 1. The next three cards (for player 1, cards 4 to 6) are not marked and used for next round. The following 2 cards (for player 2, card 7 and 8) should also be marked. The marking process of entering "yes" into the used? column should be based on the aformentioned two cells that count the # of cards used by each player. Again, the population of player 2 cards should start from the 7th card that hasn't already been used.

    I would really appreciate any help and I know this many not be super clear; please let me know if I can clarify further. Thanks in advance!

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Populate a defined number of blank cells in a column with "yes"

    You do no describe what a player does to "use" or "reveal" a card. I suspect you could use that event to populate the cell related to the used or revealed value.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    05-16-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2013
    Posts
    2

    Re: Populate a defined number of blank cells in a column with "yes"

    Yes, I've attached code to populate the next blank cell to the "reveal card" macro. Thanks very much!

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Populate a defined number of blank cells in a column with "yes"

    Quote Originally Posted by goleafsgo View Post
    Yes, I've attached code to populate the next blank cell to the "reveal card" macro. Thanks very much!
    Happy to help,
    Regards, JLG

+ 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] New Excel Formula needed using IF to populate cells if "*" is added to a column
    By pidnani in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 12-17-2015, 07:06 AM
  2. Populate all blank cells with absolute zero ("-") in a range?
    By dgibney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2015, 11:40 AM
  3. Replies: 2
    Last Post: 07-23-2015, 07:10 AM
  4. [SOLVED] if formula needed to populate either "1" or "0" based on number of units in another cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2015, 11:24 AM
  5. "for each" loop in controls to populate user-defined type
    By njs27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2015, 04:57 PM
  6. [SOLVED] Keeping particular cell blank if the related cells show "0" or "blank"
    By Anuru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-24-2014, 05:30 AM
  7. [SOLVED] Replace all BLANK cells in column with header title "Balance" to "0"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2014, 09:25 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