Alright, so I’ll get laughed at here, but one of my ‘goals’ for work this year is I wanted to take the 4 hour VBA course on youtube and then write a small program after it that does something.
Before you laugh at me using an outdated language, I only chose it because a co worker suggested learning it, and we do use some VBA coded macros in our spreadsheets. We’re not a very up to date company.
The reason I never get anything done with learning programming is I never know what to do . And if I do come up with something to do, it will be WAYY too complex over my head, i’ll fail at it, then never touch it again. If it’s too simple, I won’t even want to bother. (Yay ADHD)
So I’m just looking for a couple suggestions for a fun little program to make (and consider the goal ‘done’). I know calculators of some sort are an option…I can’t really think of anything else. I guess it doesn’t actually have to be a useful program but it would be cool if it was.
At work, if you already have an existing workflow or process that’s repetitive and you have some level of familiarity with, start with that. You will already be clear about the outcomes you want.
VBA is nice in that since you are manipulating an Office product (usually Excel), you get to see what your code actually does in “real-time”. Running the code line by line (Debug mode IIRC) helps.
Don’t worry about it being “old”, it’s still useful in most corporate settings and like others have said, much of the concepts are transferrable. Myself I went on from VBA to other Microsoft products like Power Query and DAX.
One word of advice, always work on copies! Treat VBA processes as destructive and non-reversible!!! Last thing you want is to mangle “live” files beyond repair…
Have fun :)
VBA can be used in place of scripts on Windows through the use of
wscript.exe, so you might want to find any small thing you want to automate and figure out how to do thatYou can always look for an existing Office-based process that is tedious and manual, but fairly mindless.
Try making a game. I think minesweeper might be a good one because it can be broken down into many different problems with different complexities. Like user input could start out as entering coordinates into specific cells to interact with a seperate grid, then you could switch to using an input grid where you enter a value into the cell you want, and then move on to clicking on cells like in the real minesweeper, including different behaviours for left, right, and both clicks.
Pretty sure you could implement a full version of minesweeper in excel, though even if you can’t get all the way, there should be enough low hanging fruit you can reach to learn a lot from the process.
Or if you’re feeling really ambitious, I think a realistic physics racing simulator is also possible, though I wouldn’t expect a lot on the graphics side of such a thing. Just lots of formulas that then get used to simulate a car accelerating, braking, and turning. But this one might also be great to get started with because you can start with a simple model and add complexity from there.
Hey man, someone’s gotta learn VBA! It’ll probably outlive both of us, if Microsoft keeps it around in any capacity.
Functions are somewhat useful in VBA although learning LAMBDA in cell formulas (and named ranges) would probably serve you better at this time.
So instead I would say focus on writing a Sub. The one I used for myself students was to turn the current selection into a checkerboard by resizing column width to 2 and coloring every other square black (or any color).
I taught myself VBA when I inherited a job that involved taking data from multiple sources and producing summary reports of various types for multiple stakeholders. The person before me spent days each week doing it, it took me about a week of learning and playing to bring that down to 5 minutes or so.
I found VBA useful for dealing with administrivia.
I ended up doing similar things multiple times afterwards, with variations on source data (excel, text files, word docs), source data location (local drive, network, databases, SharePoint) and output (pivots, charts, tables, text files, email, word docs, etc.) depending on what was needed. Someone else mentioned data validation already.
Automate the boring stuff.
Personally I always get excited by process automaton. Been a minute since I’ve done any VBA but my favorite projects I used it for were probably:
- Bulk updating CAD models and drawings as part of rebranding. (Solidworks)
- Interacting with a 5250 emulator (AS400) to automate the data entry/extraction I was doing
The best part of vba is you can record a Macro then edit it. I think you should start by adding a button that shows a message box when you press it, then record a Macro and throw some message boxes in it to see what values are used. Beware, office 365 has some other thing besides vba that I’m not familiar with, you may be better off learning that.
Create custom functions. Excel has lots of built in functions. “SUM()”, “CONCAT()”, etc. You can use VBA to create your own functions that manipulate data within cells.
I’ve never written any Visual Basic (A or otherwise) but I was under the impression that VBA was just for extending functionality of existing Microsoft Office applications, no?
Which of these are you interested in using?



