Visual Basic

Discussion in 'Careers' started by veeko, May 7, 2006.

  1. veeko

    veeko Member

    Can anyone recommend a way to learn VB from scratch?
    Would books be of any use? Any tutorials available anywhere???
     
  2. Dha

    Dha Member

    It depends on whether or not you know computer programming already? Have you ever done C++?
     
  3. LouiseF

    LouiseF Member

    Hints for VB Programming

    My favourite way to learn a programming language from scratch is to canabilise other peoples programmes! Grab a few from the office file and take a look through them. Run each line individually if you have to (F8 I think). Also MAKE NOTES! If you come across something that you think might work well, write it down, you'll never be able to find it again.

    Another good trick is to record loads of macros. This is under the tools menu. That way you can write programs quickly by adding recorded lines together.

    VB Help isn't too bad (and I stress the word too). We also have a book in the office called "Teach yourself VBA in 21 Days". Can't say I started at page one and worked all the way through, but it's quite a good reference.

    Finally, remember that when you're typing in VB there are often prompts that come up -arguements in functions etc, that are really helpful.

    Have fun.
    Louise
     
  4. Cymro Card

    Cymro Card Member

    I'm pretty much self-taught out of necessity, so have followed Louise's route. For this, is it's a steep learning curve; against is you pick up some bad habits :rolleyes:

    I find help okay if you kinda know the answer but just need the finer details (i.e how a command is actually written) but pretty darn useless if you're not sure how to do something.

    In these cases I turn here: Microsoft Discussion Group - if you have a hotmail account, you can even post questions (and they are pretty quick/helpful with their responses)

    One last word of warning - you're coffee intake will increase whilst you wait for badly written macros to fall over! Or maybe that's just me! ;)
     
  5. veeko

    veeko Member

    Thanks guys - I am completely new to programming. I'll try the things you've mentioned. I'm quite familiar with recording and editing macros, but nothing overly complex. Its writing and coming up with my own ideas which I'd like to improve on in this sense!

    Dha - I've never used C++ before - do you think its worth learning a bit of this too??
     
  6. Gareth

    Gareth Member

    i would begin by trying some free online tutorials and then look for a book,

    e.g.

    thing from: http://www.google.co.uk/search?hl=en&q=+vba++tutorials&btnG=Google+Search&meta=
    such as:
    http://www.danielklann.com/tutorials/tutorial_index.htm

    i would advise against c++ until you have mastered visual basic, it's very different and you will spend ages learning about things like memory allocations, stacks, heaps etc, which detracts from what you are probably interested in (i.e. writing business apps).

    if you get stuck, you can always post questions here, and i would be happy to help.
     
  7. Greg

    Greg Member

    I believe there is a "Visual Basic for Dummies" book. (though i may be wrong).

    This is by no means an endorsement to get it but it may be useful. Some people love the "for dummies" series. Others hate it. It will start very low level and you would probably find it very slow and easy at first but it may be useful depending on your style of learning things. There are other books though also (cant remember any names). I agree though with whoever said "canniablise other peoples programs". You can tweak code other people have done - just making tiny little changes. Then get more adept at doing it and eventually you're happy to program from scracth yourself. Although this is coming from someone who is rubbish at VB (I much prefered C myself...)
     
  8. Dha

    Dha Member

    I definitely wasn't suggesting you learn C++! Its definitely harder. But if you did know any programming language, it'd be fairly easy to pick up VB. It's one of the easier ones, IMO.
     
  9. James

    James Member

    I would agree with Gareth that online tutorials and a book are the best way.

    But I've always found I only really learn a language properly if I also have to write some real programs in conjuction with reading the books etc.

    As Cymro mentioned using the record macro facility will teach you some really bad habits. I started this way and it has taken me longer to unlearn all the bad habits than it did to learn VB in the first place. What the record macro facility is good for is finding out what the VB command is for a particular thing you want to do - you can then look in the books and in the help how to use it properly.

    Forums are also really useful - some of the people on this one seem to spend a scary amount of time solving other peoples problems:

    http://www.xtremevbtalk.com/
     
  10. avanbuiten

    avanbuiten Member

    I put visual basic on my cv to get an actuarial job.

    I didn't however know it though!

    I bought a 'Teach yourself Visual Basic in 72 hours' book.

    Guess what?

    I learnt it in about 20 hours!!!

    The book really worked - And I had no problem writing VB programs on my 2nd day of employment (bit of a surprise to me)!!!

    VB is probably about the easiest programming language around - especially since you can record macro's to get an idea of what the code structure may look like & then adapt it.

    I strongly recommend the same book I described above.
     
    Harashima Senju likes this.
  11. leafy

    leafy Member

    Are you looking for straight Visual Basic? or Visual Basic for Applications?

    Took me a while to notice the difference, but "Visual Basic" is a general programming language, and can be used to create stand-alone applications. (I keep meaning to learn how to do this).
    Visual Studio helps a lot with this if you can afford it, although it is generally quite high level.

    Visual Basic for Applications is what you would use to put macros in Excel, and to manipulate Excel Workbooks, Access databases and Word Documents etc.
    I taught this to myself very rapidly, and now use it in over 75% of the work that I do to make my life easier.

    If this is what you were looking for then I can recommend the Excel "Record" button. Now that I can program properly I hate that button but I have to admit that it is a great place to learn from.
    Start recording a macro in excel, do something simple like highlighting a row, stop the macro and check the Visual Basic editor for the code.
    It won't take you long to work out the syntax and what everything does as it is pretty self-explanatory, and within no time you'll be copy-and-pasting chunks of the code to make it do what you want it to do.

    Leafy
     
  12. p51ngh

    p51ngh Member

    People seem to be confusing Excel VBA with Visual Basic. I think Excel VBA is the one you are after. It is a baby compared to Visual Basic.

    I wouldn't recommend you learning Visual Basic as I am thoroughly anti-microsoft. I would suggest you learn some Perl if you want to know how to program. Also have a look at Star Office, which is an open-source version of the MS office Suite. You can write plug-ins in Perl to go with Star Office, and you'd be able to do some really funky stuff.

    Visual Basic is for people with learning disabilities, just like Windows.
     
  13. veeko

    veeko Member

    Surprised to say that I haven't heard about "Perl" - do any employers use it???
     
  14. sebb

    sebb Member

    No offense but i dont think that learning perl is likely to be of any use. I highly doubt his employer uses Star office and I would imagine that, like the majority of actuarial students I know, his employer will just want him to be able to write a few macros for excel.

    I can thoroughly recommend "writing excel macros" see http://www.oreilly.com/catalog/exlmacro2/
    I did however come from a programming background so others might not find it so useful.

    I'm also a big fan of Windows and other microsoft programs so maybe I'm too stupid to comment.
     
  15. leafy

    leafy Member

    That's a really unhelpful, and frankly insulting, comment.
    I'd bet dollars to donuts that the person who asked for VB help works in an office with computers running Windows, and who uses Office on a regular basis.
    In this context Visual Basic can give you a superior edge over colleagues that can't use it.

    What possible use could learning Perl or getting Open Source Office packages have in this case?

    Don't get me wrong, I'm a fan of Open Source, and run Linux at home, but having learnt Visual Basic, and being the only one in my company who can use it, has made me a rather valuable commodite.

    Leafy
     
  16. veeko

    veeko Member

    Looking to learn both.............. I'm quite sure that both will help! I know the basics about macros and all, but its coming up with my own ideas and trying to manipulate the code which I want to improve on e.g. leafy mentioned in a previous post that he designed a program to solve SoDoku - I think this is quite creative and good!

    Being in pensions, there isn't too much new stuff I could bring with VB (we already have many applications that use VB and VBA) - I think it will be a great plus when I decide to move from the pensions environment.

    So far the suggestions have been good and will look at them in more depth. Thanks.
     
  17. leafy

    leafy Member

    Wow, either you've had a few boring lunchtimes or you have a great memory!

    This is undoubtably the best way to learn a programming language...just start to play and see what you can come up with. You'll be amazed how often a routine that you created for a little game will come in handy in a business situation!

    In terms of comparison with other programming languages Visual Basic is very weak. When you start wanting to do something serious then it is worth learning one of the more standard languages.

    However, if all you are interested in is developing you intuitive programming skills then personally I think there are few that are better.
    Taking my Sudoko solver for example. I'm sure many people here will scoff that writing it in Visual Basic is a laughable idea, but since I don't know how to make graphical applications of my own Excel provided the perfect grid structure for entering and retrieving the numbers, and I had some fun writing the program for it that I could simply transfer to a more standard language if I was every bothered.

    And everything helps. Count the number of people above who have made a recommendation and then qualified it with "but I had programmed before so it was easier for me". You have to start somewhere and the learning curve is exponential!

    Personally my route was BASIC (on an Acorn Archemedes) when I was about 10, C during my university degree, html/php/c#/VB/VBA/VB.NET/Java within the last 2 years!
    I'd be interested to see what routes into programming other people took...

    Leafy
     
  18. p51ngh

    p51ngh Member

    I know of many employees who use it

    Yes it is... but no offence intended. If you use open source, you'll know what I mean!

    FYI: Star Office = MS Office in open source form.
    My employers don't use Star Office, but I do, and the work is very portable to other windows machines. My empolyers don't care how I do my work and most of them are anti-microsoft aswell.

    I cringe ;) whenever someone says something like this.
     
  19. sebb

    sebb Member

    I know exactly how you feel. I cringe when people say things like that! It's the attitude you get from reading too many computer magazines instead of forming your own opinions. ;)
     
  20. p51ngh

    p51ngh Member

    :rolleyes: yeah... whatever
     
  21. Gareth

    Gareth Member

    im a big open source fan, but i find openoffice is still not mature enough to use in place of Excel (although it's Writer is far superior to Word imo).

    also, it really needs to steal VBA instead of it's own macro language, if it wants to become a serious contender.

    one last thing, if you want to learn programming, stick to popular languages in the business world - e.g. c++, c#, vb.net, vba

    while perl is undoubtably a strong language, not very many people use it, so it wont make you money!
     

Share This Page