• Home
  • Blog
  • Bowie State University Excel Project

Bowie State University Excel Project

0 comments

  1. Set up.
    1. Create a new Excel file and save it as a macro-enabled file Final_YourLastName_YourFirstName.xlsm.
    2. Rename Sheet1 to Poker.
    3. Switch to VBA Editor.
    4. Rename Sheet1 to SheetPoker.
    5. Insert a new standard module and rename Module1 to ModulePoker.
  2. Create three buttons.
    1. Switch to worksheet Poker.
    2. Create a button occupying range A2:B3.
    3. Add new macro name: ButtonDeal_Click.
    4. Store macro in: This Workbook.
    5. Switch to worksheet and rename button text to Deal.
    6. Create a button occupying range A4:B5.
    7. Add new macro name: ButtonSort_Click.
    8. Store macro in: This Workbook.
    9. Switch to worksheet and rename button text to Sort.
    10. Create a button occupying range A6:B7.
    11. Add new macro name: ButtonClear_Click.
    12. Store macro in: This Workbook.
    13. Switch to worksheet and rename button text to Clear.
  3. Set up lookup table onto columns G, H and I.
    1. Lower = 1, Upper = 13, Suit = Spade.
    2. Lower = 14, Upper = 26, Suit = Heart.
    3. Lower = 27, Upper = 39, Suit = Diamond.
    4. Lower = 40, Upper = 52, Suit = Club.
    5. Name this range LookUpSuit.
  4. Set up lookup table onto columns K and L.
    1. Mod = 0, Rank = Ace.
    2. Mod = 1, Rank = 2.
    3. Mod = 2, Rank = 3.
    4. Mod = 3, Rank = 4.
    5. Mod = 4, Rank = 5.
    6. Mod = 5, Rank = 6.
    7. Mod = 6, Rank = 7.
    8. Mod = 7, Rank = 8.
    9. Mod = 8, Rank = 9.
    10. Mod = 9, Rank = 10.
    11. Mod = 10, Rank = Jack.
    12. Mod = 11, Rank = Queen.
    13. Mod = 12, Rank = King.
    14. Name this range LookUpRank.
  5. Write comments for every macro and every code block below.
    1. Switch to VBA Editor.
  6. Implement click event handler ButtonDeal_Click.
    1. Set range C1 value to Random, and change it to bold style.
    2. Set range D1 value to Suit, and change it to bold style.
    3. Set range E1 value to Rank, and change it to bold style.
    4. On range C2:C6, generate random integers between 1 and 52, then copy and paste by values onto the range itself.
    5. On range D2:D6, use the value on column C to look up the Suit value in the lookup table on range LookUpSuit.
    6. On range E2:E6, use the remainder of the value on column C divided by 13to look up the Rank value in the lookup table on range LookUpRank.
    7. Start on range C1 to include all connected data cells, and name the whole data range as Cards.
    8. Set the horizontal alignment in range Cards to Center.
  7. Implement click event handler ButtonSort_Click.
    1. Sort range Cards by ascending order on column C.
  8. Implement click event handler ButtonClear_Click.
    1. Clear all contents and formats on range Cards (or columns C, D and E).
  9. Save, attach and submit your completed Excel file.
    1. Your complete worksheet Poker would be:

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}