PDA

View Full Version : Basic VBA Stuff



JohnnyBravo
10-13-2005, 10:00 PM
Not exactly O/T question but I didn't know where to post my question. Feel free to move it to where ever necessary.

This is my first time coming to this forum and i'm overwhelmed w/ the complexity and versatility of VBA. My first taste of working with VBA was only a few months ago working wiht an Excel workbook.

Is there some way to learn just the basics? Things like syntax, commands, where and when to use periods (.) in b/w commands as in 'ActiveDocument.Close'.... it's all foreign to me. I feel as though if i could just get a few basic concepts down, it would be more enjoyable for me. Right now it's pure fustration and complete confusion.

I'm not a computer newbie - been fixing PC's for several years now. And even programming terminologies like If/Then statements are not "geek" to me - I did take a beginner's programming language class in college back in the day. It's so old some of you probalby have never heard of it. ANYWAY - the point is that I consider myself a quick learner - and if i could just get a small piece to chew on and practice, I'd probably latch onto this fairly quickly. Thanks 4 listening to my ramble.

I would certainly appreciate any comments, or suggestions on how to go about teaching myself, cuz i would love to know more.

Jacob Hilderbrand
10-13-2005, 10:49 PM
One easy way to learn (at lest for me) is to use the Macro Recorder (Tools | Macro | Record New Macro...). Just start the recorder and make some changes to the workbook, then stop recording and check out the code.

Another way is to check out the available methods and properties via VBA intellesense. For example, if you want to see what you can do with a range, try this. Go to the vba in insert a new module (Insert | Module). Then type this.


Dim r As Range

r.


When you type "r." a pop-up list will be shown of all the various things you can do.

You should also check out the Knowledgebase (www.vbaexpress.com/kb) and articles (www.vbaexpress.com/forum/articles.php) section. As well as the various forums here.

We also offer Excel VBA Training (www.vbaexpress.com/training). It is geared towards beginner coders, and you can review lesson 1 for free. It should get you started.

Bob Phillips
10-14-2005, 01:09 AM
Not exactly O/T question but I didn't know where to post my question. Feel free to move it to where ever necessary.

This is my first time coming to this forum and i'm overwhelmed w/ the complexity and versatility of VBA. My first taste of working with VBA was only a few months ago working wiht an Excel workbook.

Is there some way to learn just the basics? Things like syntax, commands, where and when to use periods (.) in b/w commands as in 'ActiveDocument.Close'.... it's all foreign to me. I feel as though if i could just get a few basic concepts down, it would be more enjoyable for me. Right now it's pure fustration and complete confusion.

I'm not a computer newbie - been fixing PC's for several years now. And even programming terminologies like If/Then statements are not "geek" to me - I did take a beginner's programming language class in college back in the day. It's so old some of you probalby have never heard of it. ANYWAY - the point is that I consider myself a quick learner - and if i could just get a small piece to chew on and practice, I'd probably latch onto this fairly quickly. Thanks 4 listening to my ramble.

I would certainly appreciate any comments, or suggestions on how to go about teaching myself, cuz i would love to know more.

Get a book. E.g. John Walkenbach's VBA For Dummies.

Cyberdude
10-19-2005, 08:51 PM
Two good sources to use are the VBA Help facility, and DO use the VBAExpress forum to help you through problems. xld is correct in saying that you really should have at least one good, two-inch thick reference book. I've used J. Walkenbach's books for years, but there are other good ones too. Check Amazon.com and eBay for good prices. :thumb