Excel VBA Programming?
I would like to learn Excel VBA programming. I am comfortable working with Excel ( I’m a secretary and I feel my excel knowledge/experience is better than the average secretary) however, I can’t seem to find any basic VBA guides online. Excel VBA Programming for Dummies was suggested to me (by a programmer) but I haven’t gotten it yet. I was wondering if there is any FREE internet tutorial or guide that would be good for a beginner. (the other stuff I have found online is for people already familiar with programming in general, and this is my first delve into programming)
- devilishblueyesLv 71 decade agoBest Answer
I've been programming in Excel VBA since about 1997 when VBA was first installed in Excel. I've read VB6 books, VB.Net books and looked through tons of websites online.
If you're truly wanting to learn Excel VBA then don't try learning VB6, VB.Net or Basic. They are similar, but Excel VBA has its own little quirks that make things you lear in those books not relate all of the time. Plus, those books are harder to learn.
I hate to be one to give bad news, but you're not really going to find a good website on how to program in Excel VBA. You'll find web pages here and there that tell you how to do specific things where people have questions, but there is no website that really does a good job of teaching the fundamentals.
My best recommendation would be to buy either Excel 2007 Power Programming with VBA or Excel 2003 Power Programming with VBA. John Walkenbach is the author and he does a great job of explaining the fundamentals and teaching you what you need to know in the order you need to learn it.
He teaches you things you need to know like how different versions of Excel have different numbers of rows and columns and how you can write your coding to adjust for that. Another thing he teaches is how to write your code so that it is efficient. If I write a For Next loop, it doesn't make sense to have it loop through every cell on the worksheet to find the number of cells on that worksheet that have the name John in them. Instead, I can limit the loop to search through the UsedRange or box of used cells so that the macro finishes in much less time. Or I can transfer the data to an Array and search through the array to make it even faster yet.
Then you have stuff like looping through and deleting rows. Normally, everybody is used to going from top to bottom. But to delete rows you need to delete starting at the bottom of the worksheet and work your way towards the top. This is because the rows move up when you delete a row. Then when your macro goes through its next loop you skip over a row if you delete from top to bottom instead of from bottom to top.
I tried teaching myself from the programming books and the web for almost 8-10 before I got his book. I learned more in a month or two from his book on VBA than I did in several years through the other methods.
Spend the money. It's worth getting his book. I looked on www.directtextbook.com and you can get the 2003 version new for $22.97 or the 2007 new for $25.92. Compare that with the hours you'll waste trying the other methods and its well worth every penny.
- 1 decade ago
If it's your first delve into programming, I'd learn programming first. You should probably start with learning Visual Basic, since that is closest to VBA.
The complication is that VBA is based on Visual Basic 6.0, and Microsoft has abandoned that in favor of Visual Basic 7.0, 8.0, and 9.0, which are called Visual Basic .NET.
If your goal of learning programming is solely to use VBA, I'd look for tutorials and examples of learning VB6. You can use most of what you learn immediately in VBA, and for the rest, find VBA tutorials, or teach yourself by recording macros and looking at the code it produces.
VB6 is not free but you can get a limited version of VB5, which is very similar, for free, which is suitable for practicing: http://www.thevbzone.com/vbcce.htm
But if, as is presumable, you want to know programming anyways, you should learn VB.NET, the current versions (2008). Microsoft provides this free (it's called Express: microsoft.com/express/vb/Default.aspx) and provides tutorials & videos and so do many others.
Then, you can go back to the VBA tutorials to apply it to Excel. As said VBA is a bit different, and a bit simplified once you know .NET, but is syntatically very similar and it shouldn't be too hard to learn.
Good luck!Source(s): 15 yrs programming, experience with VBA, VB6, and VB.NET
- How do you think about the answers? You can sign in to vote the answer.
- NanoinfinityLv 51 decade ago
Listen to what user Devilish told you - do NOT try to learn VB.NET or even VB6 and then try to apply that to VBA - it doesn't work.
VBA is a stripped-down version of VB6 that has a lot of quirks and different features of its own. You can become an excellent programmer in VB6 and then switch to VBA and be absolutely stumped because things are so different, and simple tasks become harder. It would be a waste of your time to first learn Visual Basic, then switch to Visual Basic for Applications and never be able to apply the tricks and methods you learned from VB6/.NET to VBA.
I basically self-taught VBA, but I have general computer programming knowledge to back me. I've just spent a lot of time on Google and searching through code banks for workarounds, code snippets, error reports and the like. In the sources, I've listed a few of the sites I keep going back to for tips and help. (These probably won't help you learn, but they will be able to help your "How do I do this...?" type questions)
You won't find extensive walkthoughs for "learning VBA" online... most sites will tell you how to do one thing or another, but they won't thoroughly walk you through the process of learning and then becoming an expert. The books that Devilish mentioned seem promising.
Good luck!Source(s): A blog dedicated to excel VBA programming http://www.dailydoseofexcel.com/ A forum you can search or post in for help. They have code banks too. http://www.vbforums.com/forumdisplay.php?f=37 Working with charts in Excel/VBA. Some of this will probably be too complex, and not all of it is code-based, but I've used a lot of information from here http://peltiertech.com/Excel/ChartsHowTo/index.htm... There is a lot of informative posts in this forum; going through Google is probably easier than navigating this one. http://www.ozgrid.com/forum/forumdisplay.php?f=2 A VBA code bank - If you need to do something tricky, someone's probably already written it! http://www.vbaexpress.com/portal.php Edit: I forgot to include Experts Exchange. This is normally a pay-site, meaning you have to pay to see the answers, HOWEVER if you navigate to it though google's search result link and scroll all the way to the bottom of the page, you can see all the answers. This should work with all search engines, because EE has to show the answers in order to be included in the search results. here's a link to a google search of "VBA" limited to only the EE site http://www.google.ca/search?hl=en&rlz=1G1GGLQ_ENCA...
- Anonymous1 decade ago
I'd actually start at a slightly lower level - basic (not Basic) programming. Try http://www-old.oberon.ethz.ch/WirthPubl/AD.pdf
Then learn Visual Basic.
If you just want to start writing things and learn as you go (it's actually more difficult, but the difficulty is spread out over years, rather than a couple of months), the "Dummies" books, and others of that type (there are at least 2 other lines like that) are pretty good.
But knowing programming makes a lot of VBA kind of trivial.
- Anonymous5 years ago
I think Excel has lot of various advantage to do various types of works, particularly numerical works.From the excel spreadsheet any one can meet his calculation with various criteria. Excel VBA programming is like to vb programming.Many advantage of vb programming as like as excel VBA.So in this circumstance we can say excel/ vba is also a programming.
- 6 years ago
You can find alot free online training webistes,
my suggestion is to dont just learn or read, you must practice each and every code you see on web.
Which I have done for 6 months continues, now I can do a bit programming.
Thank you,Source(s): <a href="www.fiverr.com/venkatpvc">Excel VBA Freelancer.</a>