+ Reply to Thread
Results 1 to 5 of 5

Need learning resources for VBA syntax

  1. #1
    Forum Contributor rinser's Avatar
    Join Date
    02-27-2009
    Location
    Bucharest
    MS-Off Ver
    MS Office 2013
    Posts
    103

    Need learning resources for VBA syntax

    Hi All,

    I would like to know where can I find a good resource to learn about VBA syntax. I have VBA books and there are some examples of code in there but when I'm trying to read someoneelse's code I just get into commands or syntax I don't understand. For example I would like to be able to go some site and decifer what this line (or it's parts) means:

    If(cnt < MAXTEST, sDigSep & String(MAXTEST - cnt, "9"), "")

    Where can I find such information?
    Thanks.
    Last edited by rinser; 04-11-2009 at 09:53 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Need learning resources for VBA syntax

    Well, I'm not too experienced but it looks to me like that isn't VBA. You don't use parantheses on IF statements in VBA.

    Regardless, I've learned most of what I have on this site. Just look at people's questions and try to find the answer. When they do get answered, compare the answer to how you would have answered it.

    The best way to learn is just to do it. Repition helps
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor rinser's Avatar
    Join Date
    02-27-2009
    Location
    Bucharest
    MS-Off Ver
    MS Office 2013
    Posts
    103

    Re: Need learning resources for VBA syntax

    Hi davegugg,

    Thanks for advice, indeed following the posts and answers and trying to find solutions is I guess the best way to learn VBA. I am learning from a book and it helps to see real-world examples.

    You guessed about the code: that's not VBA its VB and with some errors on top .

  4. #4
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373

    Re: Need learning resources for VBA syntax

    Hi rinser

    Are you sure you're not forgetting one "i"?

    IIf(cnt < MAXTEST, sDigSep & String(MAXTEST - cnt, "9"), "")
    Last edited by lecxe; 03-25-2009 at 02:30 PM.

  5. #5
    Forum Contributor rinser's Avatar
    Join Date
    02-27-2009
    Location
    Bucharest
    MS-Off Ver
    MS Office 2013
    Posts
    103

    Re: Need learning resources for VBA syntax

    Hi ,

    Indeed the formula was IIf Well spoted!

    By the way if you need a challenge you could take a look at my other posts

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1