ChessExcel is a simple chess game built entirely in Excel using VBA macros. The board is drawn with Unicode chess symbols, pieces are moved by selecting cells, and turns are managed via an ActiveX button. This repository contains the macro-enabled workbook (ChessExcel.xlsm) and all exported VBA modules for version control.
Before running the game, ensure macros and ActiveX controls are enabled in your Excel:
-
Show the Developer Tab
- Go to File > Options > Customize Ribbon.
- Under Main Tabs, check Developer and click OK.
-
Enable Macros
- Navigate to File > Options > Trust Center > Trust Center Settings….
- In Macro Settings, select Enable all macros.
- Check Trust access to the VBA project object model.
-
ActiveX Settings
- Navigate to File > Options > Trust Center > Trust Center Settings….
- In Trust Center, go to ActiveX Settings.
- Select Enable all controls without restrictions and without prompting.
- If necesary, unblock the file
- Right click on the file > properties
- In Security, check que box "Unblock"
- Clone* this repository:
git clone https://github.com/MarcBasas/ChessExcel.git
- Open
ChessExcel.xlsmin Excel. Ensure the VBA modules (inModules/) remain alongside the workbook for versioning.
*You can also download the .zip of the project
- Open the ChessExcel.xlsm file in Excel.
- On the Developer tab, click the button Play
- The board will initialize with all pieces in starting positions.
- Click on a piece you want to move ( yes, starts with the whites. select origin).
- Click on the target square (select destination).
- The piece will move if the move is valid.
- After each move, click Next Turn to switch players.
- Repeat moves until checkmate.
ChessExcel/
├── ChessExcel.xlsm # Macro-enabled workbook
└── Modules/
├── Module1.bas # Draws the board and initializes pieces
├── Module2.bas # Returns piece identifiers. Movement logic and turn
├── Sheet1.cls # Worksheet event handlers
└── ThisWorkbook.cls # Workbook open initialization
All code in this repository is open and can be freely reviewed. There are no hidden or malicious components—feel free to inspect every module for peace of mind.
This project is licensed under the MIT License.
Enjoy your game of Chess in Excel! Contributions and improvements are welcome.