Results 1 to 9 of 9

Thread: Any good VBA books?

  1. #1
    Senior Member
    Join Date
    Feb 2007
    Posts
    243
    Thanks
    30
    Thanked
    9 times in 9 posts
    • stroberaver's system
      • Motherboard:
      • Abit IP35 Pro
      • CPU:
      • Intel E8400
      • Memory:
      • 4GB Corsair XMS2 DDR2-800
      • Storage:
      • 1.6 TB combined between PC and NAS
      • Graphics card(s):
      • GeForce 8800GT 512MB
      • PSU:
      • Tagan T480-U01
      • Case:
      • Antec P182
      • Operating System:
      • Windows 7 Professional
      • Monitor(s):
      • Viewsonic VP-171S
      • Internet:
      • Cable broadband 10meg

    Any good VBA books?

    I'd like to learn more about VBA in my spare time as it would prove very useful/valuable at work. It's primarily for Excel but of course the principles would apply throughout Office.

    Can anyone recommend any books worth getting on VBA? I can sort of follow existing VBA code and make basic modifications to it, so I'm no dummy and don't think I want a Dummies Guide, but I don't want some professional programmers reference either! I guess just something that teaches the principles and is also a useful reference.

    Of course there are plenty reviews on Amazon but any other source of feedback would be great.

    Thanks in advance.

  2. #2
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,230
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Any good VBA books?

    Hmmm, not so easy - as each Office app has a different set of object libraries it's hard to find a book on "VBA" on it's own (they tend to be app sepcific). I had a very good Access VBA book which I can dig out and let you know the details of if you're interested - if you can find an Excel one in the same series that'd probably be your best place to start. SAMS Teach yourself books are also generally very well written and easy to follow, *if* they do a VBA one...

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Any good VBA books?

    the thing with VBA been a strange barstadisation of VB unique to each application, is that because its twisted for each app, you really find the hard part is learning each apps insanities!

    If its mainly for excel, then i'd buy an excel dev book, the best one is:
    http://www.amazon.co.uk/Professional.../dp/0321262506
    throw new ArgumentException (String, String, Exception)

  4. #4
    Senior Member
    Join Date
    Feb 2007
    Posts
    243
    Thanks
    30
    Thanked
    9 times in 9 posts
    • stroberaver's system
      • Motherboard:
      • Abit IP35 Pro
      • CPU:
      • Intel E8400
      • Memory:
      • 4GB Corsair XMS2 DDR2-800
      • Storage:
      • 1.6 TB combined between PC and NAS
      • Graphics card(s):
      • GeForce 8800GT 512MB
      • PSU:
      • Tagan T480-U01
      • Case:
      • Antec P182
      • Operating System:
      • Windows 7 Professional
      • Monitor(s):
      • Viewsonic VP-171S
      • Internet:
      • Cable broadband 10meg

    Re: Any good VBA books?

    Cheers.

    I knew each Office app had a unique set of properties and objects in VBA, but had assumed that some things would be transferable. But yes, primarily it would be in Excel. That "professional excel development" book looks a bit scary though - worried that most of it will go straight over my head!

  5. #5
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: Any good VBA books?

    I found that the recording feature, Google and the help file are good enough to start learning VBA. At first your code will be inefficient and slow, but once you get some experience you can think about how to write efficient code.

  6. #6
    Senior Member
    Join Date
    Feb 2007
    Posts
    243
    Thanks
    30
    Thanked
    9 times in 9 posts
    • stroberaver's system
      • Motherboard:
      • Abit IP35 Pro
      • CPU:
      • Intel E8400
      • Memory:
      • 4GB Corsair XMS2 DDR2-800
      • Storage:
      • 1.6 TB combined between PC and NAS
      • Graphics card(s):
      • GeForce 8800GT 512MB
      • PSU:
      • Tagan T480-U01
      • Case:
      • Antec P182
      • Operating System:
      • Windows 7 Professional
      • Monitor(s):
      • Viewsonic VP-171S
      • Internet:
      • Cable broadband 10meg

    Re: Any good VBA books?

    Cheers - I thought about using teh intarweb to teach myself the stuff, but sometimes find it's easier to buy a book and sit down with it. It also provides extra motivation, since I've purchased the book, I'll feel obliged to get something out of it.

    Just to be clear, it's nothing massive I want to achieve with VBA. Just as an example, another dept at work came to me and asked if I knew how to input times in Excel without having to input the colons (they were thinking along the lines of using a custom cell format, but then of course Excel doesn't treat it as a time value). I had a quick google and found a free sample VBA script that did just this, so I was able to adapt it by copying to the inputting worksheet, changing the cell ranges and named references, the desired time format, and bingo, I increased their inputting efficiency by an estimated 400%. But I was just effectively guessing at what needed doing as I went along, and I'd like to know these things, and create simple but hugely beneficial bits of code to automate such tedious things.

    Of course, such skills would also greatly increase my worth to my employer, as it's the kind of organisation that has no idea of the value and efficiency a bit of scripting and automation can provide.

  7. #7
    Senior Member
    Join Date
    Jul 2009
    Location
    West Sussex
    Posts
    1,616
    Thanks
    165
    Thanked
    227 times in 208 posts
    • kompukare's system
      • Motherboard:
      • Asus P8Z77-V LX
      • CPU:
      • Intel i5-3570K
      • Memory:
      • 4 x 8GB DDR3
      • Storage:
      • Samsung 850 EVo 500GB | Corsair MP510 960GB | 2 x WD 4TB spinners
      • Graphics card(s):
      • Sappihre R7 260X 1GB (sic)
      • PSU:
      • Antec 650 Gold TruePower (Seasonic)
      • Case:
      • Aerocool DS 200 (silenced, 53.6 litres)l)
      • Operating System:
      • Windows 10-64
      • Monitor(s):
      • 2 x ViewSonic 27" 1440p

    Re: Any good VBA books?

    Quote Originally Posted by stroberaver View Post
    Cheers - I thought about using teh intarweb to teach myself the stuff, but sometimes find it's easier to buy a book and sit down with it. It also provides extra motivation, since I've purchased the book, I'll feel obliged to get something out of it.

    Just to be clear, it's nothing massive I want to achieve with VBA. Just as an example, another dept at work came to me and asked if I knew how to input times in Excel without having to input the colons (they were thinking along the lines of using a custom cell format, but then of course Excel doesn't treat it as a time value). I had a quick google and found a free sample VBA script that did just this, so I was able to adapt it by copying to the inputting worksheet, changing the cell ranges and named references, the desired time format, and bingo, I increased their inputting efficiency by an estimated 400%. But I was just effectively guessing at what needed doing as I went along, and I'd like to know these things, and create simple but hugely beneficial bits of code to automate such tedious things.
    Yes, the reason I looked at this thread is precisely because I keep thinking I should really master VBA - at least for Excel and Word - and I wanted to see what books people recommended.
    I was actually toying with buying something along the lines of Excel 2000 VBA Programmer's Reference second-hand from Amazon (http://www.amazon.co.uk/Excel-2000-V...8097205&sr=1-3) since I already know most of the basics (no pun intended!).
    I’ve actually done a fair bit of VBA programming but the main reason I don’t feel that I’ve truly mastered it is that I usually find alternative solutions far too quickly…
    …For instance your ‘enter dates without the colons’ is easily done without resorting VBA programming:
    - Format Column A as “0000” (so that for instance 410 is displayed as 0410)
    - Format Column C as date
    - Enter this formula in B1 =REPT(0,4-LEN(A1)) &A1
    - Enter this formula in C1: =IF(LEN(A1)=3,"0"& LEFT(A1,1),LEFT(A1,2))&":"&RIGHT(A1,2)
    - Then just Edit>Fill>Down (CTRL-D) as many cells down as you need.
    That’s it! And no VBA in sight!

  8. #8
    Overclocking Since 1988 nightkhaos's Avatar
    Join Date
    Apr 2009
    Location
    Sydney, AU
    Posts
    1,415
    Thanks
    93
    Thanked
    127 times in 106 posts

    Re: Any good VBA books?

    I find that if you approach the program logically you can usually achieve the desired function with some use of Google, the Help (which is fairly comprehensive, but sometimes makes little sense), and the record feature.

    The thing I find you have to understand is never assume you have found "the best" way to do something. Excel VBA is inefficent, because it is a very high level lanuage. (It executes within an application within an operating system), and also has inbuilt debuging tools (which is helpful, but means that there is a slight overhead.

    Also, this is probably told to you by every experienced programmer out there, there is more than one way to complete an objective, and each has their pros and cons. There is therefore no such thing as "wrong code", there is however "bad code." For example, if you do something in 20 steps that can be achieved in one, that is bad code. If you use a loop when one is not needed, that is bad code. Etc.

    Probably the best solution is to post here, or on some other forum, if you're having trouble achieveing a particular objective and we'll see if we can help. I find the best anwsers are usually found on forums, where someone has been trying to do something similar to me.
    Desktop (Cy): Intel Core i7 920 D0 @ 3.6GHz, Prolimatech Megahalems, Gigabyte X58-UD5, Patriot Viper DDR3 6GiB @ 1440MHz 7-7-7-20 2T, EVGA NVIDIA GTX 295 Co-Op, Asus Xonar D2X, Hauppauge WinTV Nova TD-500, 2x WD Caviar Black 1TB in RAID 0, 4x Samsung EcoDrive 1.5TB F2s in RAID 5, Corsair HX 750W PSU, Coolermaster RC-1100 Cosmos Sport (Custom), 4x Noctua P12s, 6x Noctua S12Bs, Sony Optiarc DVD+/-RW, Windows 7 Professional Edition, Dell 2408WFP, Mirai 22" HDTV

    MacBook Pro (Voyager): Intel Core 2 Duo @ 2.6GHz, 4GiB DDR2 RAM, 200GB 7200RPM HDD, NVIDIA 8600GTM 512MB, SuperDrive, Mac OS X Snow Leopard, 15.4" Matte Display

    HTPC (Delta-Flyer): Intel Core 2 Q8200 @ 2.33GHz, Zotec GeForce 9300-ITX, 2GiB of DDR2 Corsair XMS2 RAM, KWorld PE355-2T, Samsung EcoDrive F2 1.5TB, In-Win BP655, Noctua NF-R8, LiteOn BluRay ROM Drive, Windows 7 Home Premium, 42" Sony 1080p Television

    i7 (Bloomfield) Overclocking Guide

    Quote Originally Posted by Spock
    I am not our father.

  9. #9
    Overclocking Since 1988 nightkhaos's Avatar
    Join Date
    Apr 2009
    Location
    Sydney, AU
    Posts
    1,415
    Thanks
    93
    Thanked
    127 times in 106 posts

    Re: Any good VBA books?

    Quote Originally Posted by kompukare View Post
    Yes, the reason I looked at this thread is precisely because I keep thinking I should really master VBA - at least for Excel and Word - and I wanted to see what books people recommended.
    I was actually toying with buying something along the lines of Excel 2000 VBA Programmer's Reference second-hand from Amazon (http://www.amazon.co.uk/Excel-2000-V...8097205&sr=1-3) since I already know most of the basics (no pun intended!).
    I’ve actually done a fair bit of VBA programming but the main reason I don’t feel that I’ve truly mastered it is that I usually find alternative solutions far too quickly…
    …For instance your ‘enter dates without the colons’ is easily done without resorting VBA programming:
    - Format Column A as “0000” (so that for instance 410 is displayed as 0410)
    - Format Column C as date
    - Enter this formula in B1 =REPT(0,4-LEN(A1)) &A1
    - Enter this formula in C1: =IF(LEN(A1)=3,"0"& LEFT(A1,1),LEFT(A1,2))&":"&RIGHT(A1,2)
    - Then just Edit>Fill>Down (CTRL-D) as many cells down as you need.
    That’s it! And no VBA in sight!
    With any process, never underestimate the user. If you will need to write a 200 line function that can be achieved by a user in a few seconds, let the user do it. It is much easier to debug something if it simple. You can add that functionality later.
    Desktop (Cy): Intel Core i7 920 D0 @ 3.6GHz, Prolimatech Megahalems, Gigabyte X58-UD5, Patriot Viper DDR3 6GiB @ 1440MHz 7-7-7-20 2T, EVGA NVIDIA GTX 295 Co-Op, Asus Xonar D2X, Hauppauge WinTV Nova TD-500, 2x WD Caviar Black 1TB in RAID 0, 4x Samsung EcoDrive 1.5TB F2s in RAID 5, Corsair HX 750W PSU, Coolermaster RC-1100 Cosmos Sport (Custom), 4x Noctua P12s, 6x Noctua S12Bs, Sony Optiarc DVD+/-RW, Windows 7 Professional Edition, Dell 2408WFP, Mirai 22" HDTV

    MacBook Pro (Voyager): Intel Core 2 Duo @ 2.6GHz, 4GiB DDR2 RAM, 200GB 7200RPM HDD, NVIDIA 8600GTM 512MB, SuperDrive, Mac OS X Snow Leopard, 15.4" Matte Display

    HTPC (Delta-Flyer): Intel Core 2 Q8200 @ 2.33GHz, Zotec GeForce 9300-ITX, 2GiB of DDR2 Corsair XMS2 RAM, KWorld PE355-2T, Samsung EcoDrive F2 1.5TB, In-Win BP655, Noctua NF-R8, LiteOn BluRay ROM Drive, Windows 7 Home Premium, 42" Sony 1080p Television

    i7 (Bloomfield) Overclocking Guide

    Quote Originally Posted by Spock
    I am not our father.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Good books on internet
    By CaseyV9 in forum General Discussion
    Replies: 6
    Last Post: 06-05-2009, 12:26 PM
  2. Office 2007 Books?
    By JonPaulWild in forum Retail Therapy and Bargains
    Replies: 2
    Last Post: 22-03-2007, 04:48 PM
  3. Question on classifying books
    By Paul Adams in forum General Discussion
    Replies: 1
    Last Post: 10-10-2004, 09:45 PM

Posting Permissions

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