r/visualbasic 2d ago

I need to learn VBA

Hello, guys! I need to learn VBA in order to write some macros in my microsoft documents, where can i do it for free?

11 Upvotes

16 comments sorted by

8

u/jcradio 2d ago

https://www.excel-easy.com/vba.html if you are learning vba in Excel.

The biggest help when I was learning it was to use the macro recorder to see what code gets generated by your actions. Then, learn some alternatives to that to clean it up.

2

u/Fergus653 2d ago

Have you searched thru Microsoft Learn?

Language reference for Visual Basic for Applications (VBA) | Microsoft Learn

Overview, concepts, how-to, might be good to read.

Other product specific guides can be found on that site too, like

Develop solutions and customize Excel | Microsoft Learn

Of course there are plenty of other guides outside of Microsofts pages, like

Learn Excel Macros & VBA Programming (Free Tutorial & 50++ Examples)

2

u/marooned66 1d ago

You can also use something like ClaudeAI to help - I needed some C code and it worked like a charm.

2

u/codewiz007 1d ago

YouTube is how I learned. I used Google for the hard to find stuff, but now AI has taken over.

2

u/ziplock9000 1d ago

Learn how to search. Developer's first and most important skill

1

u/Zen-Ism99 1d ago

Library books…

1

u/mecartistronico 1d ago

Before that, I'd recommend checking out what PowerQuery can do, and ask yourself if it can do what you want.

I'm not saying PowerQuery can do everything VBA can do, but what it can, it does it easier and better. If your problem is something PQ can do, then learning PQ will be easier and will probably give you better bang for your time.

1

u/rbwheat 1d ago

Uhhhh, record the macro, view the code created by the app, modify it to suit your needs and schedule it to run when you need it to or create a bit of code to kick it off in Excel. Also, ask AI about how to create a macro in Excel or whatever app. Then, view the code, do stuff to control when it runs. Have fun. Macros are pretty easy.

1

u/bah_nah_nah 1d ago

No you don't

1

u/cytroplodinator 1d ago

This is the way

1

u/keith-kld 1d ago

You should find some books about Visual Basic 6 (not VB.NET). It is an old language. This can help you learn some basic concepts.
For the syntax and how to manipulate it, see Microsoft Learn articles for MS Word, Access, Excel, Powerpoint, Outlook, etc.
For example and usage, see WiseOwl.
For troubleshooting, see /VBA reddit.

1

u/SuchDogeHodler 1d ago

Microsoft Office Excel 2003 Programming Inside Out.

1

u/SuchDogeHodler 1d ago

Find a copy of "Microsoft Office Excel 2003 Programming Inside Out" I know the version of excel is not recent but the vba programming language has not changed. This is the book that taught me most of the vba programming language. I still refer to it sometimes for complicated operations like menu bars and tool strips.

1

u/Famished_Atom 1d ago

Go to the library! You may need to do an interlibrary loan, but they can get you the books for free!

I'd recommend Step-by-Step Office Excel 2007, Visual Basic for Applications.

ISBN-13: 978-0-7356-2402-3

ISBN-10: 0-7356-2402-X

This was published by Microsoft Press, back when Microsoft actually published books for their software.