views:

506

answers:

3
+2  Q: 

VBA tutorial

Hi,

At work I need to do lot of stuff with MS-Office and I managed to 'write' some scripts that do stuff instead of me. I copy-pasted it, changed some strings maybe.
It is very frustrating to just copy paste and not understand how to do it your self, for every simple thing google for something. I am not completly new to programming, just to VBA:)

Could someone throw me a link to VBA tutorial?
Something with basic syntax: 'hello world' program, loops, flow control, declare variables, variable type conversions, Objects (can I do that?), file/user input/output, when 'with' block can be used, etc.


Thanks in advance.

+1  A: 

The versions of VBA post Office 2000 are almost identical to VB6. This MSDN site is a great place to start. The VB6 resource center might also be of use.

Mitch Wheat
+1  A: 

MSDN: Developing Office Applications Using VBA

If you haven't taken a look at it already, you can learn a lot from Visual Basic help within Office. To access it open an Office program and press Alt+F11 to open the Visual Basic Editor. Then press F1 or navigate to Help -> Microsoft Visual Basic Help. Also, as Mitch mentioned, if you learn the basics of VB6 you can use the same syntax for VBA.

wcmiker
+1  A: 

This answer to a similar question may help

dbb