Excel vba class module tutorial 2024

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024
  • Learn how to create and master Excel VBA Class Modules and Object Oriented Programming using Excel Visual Basic For Applications.
    Get the spreadsheets that go with this tutorial at businessprogra...

    If you found this tutorial helpful consider supporting this channel with a steaming hot cup of coffee... Ko-fi.com/sean...

    DISCLAIMER: This video and description contains affiliate links, this means if you click on one of the product links, I’ll receive a small commission.
    If you do use one of the links, thanks I appreciate it.

Комментарии • 10

  • @m-squaredcontractors9720
    @m-squaredcontractors9720 2 месяца назад +2

    Thank you for the awesome video. Classes are very difficult to understand for me but am slowly getting there.

    • @BusinessProgrammer
      @BusinessProgrammer  2 месяца назад

      Hope this video helped, let me know If there's anything you didn't understand.

  • @noviceprogrammer2011
    @noviceprogrammer2011 18 дней назад

    Nice video with clear explanations. However .....
    when writing a program from scratch, one won't have the luxury of being told beforehand:
    1. How many classes that would be needed to be created
    2. What each one would be doing
    3. How one class might relate to another class or classes
    So what would be useful is if you could create another video outlining the steps BEFORE any code is written, ie the thought proocess, how might one plan things (which I believe is called Data Modelling).

    • @BusinessProgrammer
      @BusinessProgrammer  18 дней назад

      With all due respect, your comment doesn't make much sense, no-one tells you before hand, how many functions you're going to need or how many variables you're going to need, you can work it out as you go along. which is one of the many advantages of object orientation, it's easier to make modifications to your program as you go along, because the objects have interfaces.
      Data modeling is more for (a) Databases and (b) large projects.
      This isn't a tutorial on data modeling it's a tutorial on class modules and object orientation and it's benefits, people who write VBA programs generally aren't being "told" anything, they're usually being creative to solve a business problem.

  • @chess-s1q
    @chess-s1q 7 дней назад

    From my own investigation, classes are a starting point for something a lot more complex: object oriented programming.
    OO has been covered by many but only using languiages such as C#, Java and Python.
    Would you be creating more videos, explaining concepts such as the SOLID principles and the 23 design patterns purely from a VBA persepctive (admittedly any design pattern requiring inheritance would not be avialble in VBA)?

    • @BusinessProgrammer
      @BusinessProgrammer  6 дней назад

      What I've demonstrated here is Object-oriented programming, it is true that VBA doesn't have inheritance, which is unfortunate, but it's still object oriented and has most of its benefits, I don't have any plans at the moment to go through those principles.
      I'm more about writing solid code (no pun intended) and building useful robust applications in a practical manner that result in real benefit fast, I'm not teaching computer science.
      I've just reviewed SOLID just now, and I can say that all of my code is teaching that by implication (with the exception of inheritance) without being explicit, OO is difficult enough for newbies to get a handle on especially classes and objects without going over the top on theory.

  • @bumpersmith
    @bumpersmith 2 месяца назад

    Thank you for the video. This is helping to get me closer to understanding classes. I work in MS Access, not usually in Excel.
    Can you possibly do a video on classes in Access?

    • @BusinessProgrammer
      @BusinessProgrammer  2 месяца назад

      Classes work the exact same way in Access, You can do everything I did in VBA with the exception of how I got the data.
      What you need to do to make the code work in Access, is you would need to create a table (well you don't need to, but this is one way of doing it), create tables to represent what I did on the spreadsheet.
      Write a function to do a select query on the table and write the recordset to a one based array, or alter the code that I used to work with a zero based array, the array holds the data for the classes==>Objects. But other than that the code is the exact same.
      Is your VBA knowledge good enough to understand the above text ?

    • @bumpersmith
      @bumpersmith 2 месяца назад

      @@BusinessProgrammer Yes I understand everything and more. Just old enough to be stuck in my own thoughts and hard to break into thinking with new concepts.

  • @kebincui
    @kebincui 2 месяца назад

    👍👍