Let's Code a SNAKE GAME in Excel VBA
👉 Want to write real-world VBA code?
- Check out my course: https://bit.ly/3XTnIm8
👉 Looking for the source code for this video?
- Download it here: https://shorturl.at/jXhQh
- Subscribe to the channel here: https://bit.ly/36hpTCY
Let's Code a SNAKE GAME in Excel VBA
Want to code a fully playable Snake game in Excel using VBA? 🐍📊 In this tutorial, I'll walk you through the entire process, from drawing the game grid to handling movement, collisions and growing the snake.
🚀 What You’ll Learn:
✅ How to use a timer to control intervals
✅ Detect keyboard inputs for smooth movement
✅ How to create the starting template for any game in VBA
✅ How to use class modules effectively
✅ How to write real-world VBA code
This is a great project for beginners & advanced VBA users looking to sharpen their coding skills while having fun!
💻🔧 #VBASnakeGame #CodeSnakeGmae #ExxcelVBASnakeGame
Useful VBA Shortcut Keys
========================
Debugging:
Compile the code: Alt + D + L OR Alt + D + Enter
Run the code from the current sub: F5
Step into the code line by line: F8
Add a breakpoint to pause the code: F9 or click in the left margin
Windows:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
View the Properties Window: F4
Switch between Excel and the VBA Editor: Alt + F11
View the Project Explorer Window: Ctrl + R
Writing Code:
Search keyword under cursor: Ctrl + F3
Search the word last searched for: F3
Autocomplete word: Ctrl + Space
Get the definition of the item under the cursor: Shift + F2
Go to the last cursor position: Ctrl + Shift + F2
Get the current region on a worksheet: Ctrl + Shift + 8 or Ctrl + *
To move lines of code to the right(Indent): Tab
To move lines of code to the left(Outdent): Shift + Tab
Delete a Line: Ctrl + Y (note: this clears the clipboard)