98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsPrevious article Next article VBA articles
VBA - Not Just For Programmers
Tue 24th November 2009
Another myth about VBA is that you have to write a program or application from scratch. This isn't true and a great relief to those of you who are thinking of learning VBA but who find the prospect of a blank template to be filled with beautifully coded algorithms utterly terrifying. Most of us have heard of ActiveX Controls - if only to authorise our browsers to load them - but they are a typical component of VBA. You can simply edit existing code or use an open source 'library' of code, posted by other VBA users and have a play around with it. "Control" is the keyword here - they are the basic components of VBA. They're simple to learn, even for a non-coder and are easy to manipulate.
Let's say you're working in Word. Clicking the Developer tab (followed by Designs Mode), will give you some controls you can work with. Select on of them, and you're presented with the basic VBA editor, complete with some basic coding already (a bit like a web editing program inserting the starting tags in html). Working with VBA as a starting point, the best option to learn more is to start manipulating these controls.
To add a simple control, the UserForm function should be used within your document, then you can place controls on it. Forms hold the code in and are the essential element of working with VBA. You can also edit the form itself to get slightly different results. Coming from a non-programming perspective, you'll soon realise that VBA needn't be scary or technical. Forms, after all, are something most of us are already well-versed in on the web. Text boxes (usually created in Word, or again, in websites) are another way of adding a control to VBA.
The similarities between basic forms and the web continues with the necessity of the command button (almost like a 'submit' on a form) that executes the elements of VBA you've been working with. However, you do not always have to 'command' VBA to start its assigned task, it can be event driven - when a certain number of parameters are in place (let's say you finish processing your company payroll at the end of a month) - a simple VBA code will "recognise" you just did April, the end of the tax year, and will automatically 'know' to do the end-of-year totals. Most people know simple string arguments to create an event-driven piece of code (the old if x = y then.... School of thought). VBA is, thankfully, much smarter and more flexible than this.
Depending on what version of Office you have, (2007 is the one with the most VBA features so far, understandably), you need less and less programming know-how, as the features of Office have got more advanced with age. With the advent of Office 2010 on the horizon, why not have a go now?
Author is a freelance copywriter. For more information on access vba books, please visit https://www.stl-training.co.uk
Original article appears here:
https://www.stl-training.co.uk/article-692-vba-not-just-programmers.html
London's widest choice in
dates, venues, and prices
Public Schedule:
On-site / Closed company:
TestimonialsDefence Equipment & Support
Paul Huntley Excel VBA Intro Intermediate Very well presented, paced right, useful tips, an enjoyable experience Ellsey & Co
Technical And Quality Manager Philip Seddon Excel Introduction Very informative day. Oxford Immunotec
HR Assistant Grace Keeble Excel Intermediate Very efficient, informative and effective session, which will improve my day-to-day work. |
PUBLICATION GUIDELINES