Will Python Kill Excel VBA?

Поділитися
Вставка
  • Опубліковано 25 сер 2024

КОМЕНТАРІ • 848

  • @lucienay7803
    @lucienay7803 3 роки тому +269

    An important advantage of VBA over Python is that user can "record" their actions and Excel will "translate" it to Macros. So user needs not build it from scratch. User needs only a bit VBA knowledge and it's sufficient enough to run it from time to time. May not sound nice to hear, but it is really a nice feature when beginners are making their applications.

    • @abexlconsulting9557
      @abexlconsulting9557 3 роки тому +20

      You are more than correct.

    • @morgadoapi4431
      @morgadoapi4431 3 роки тому +5

      Another advantage of VBA and Python is that you should not touch these, at all, ever.

    • @abexlconsulting9557
      @abexlconsulting9557 3 роки тому

      @@morgadoapi4431 why?

    • @luvlycan
      @luvlycan 3 роки тому +15

      I'm working as VBA developer since last 4 years and honestly I'm feeling that now this language is becoming obsolete. :(

    • @morgadoapi4431
      @morgadoapi4431 3 роки тому +10

      @@luvlycan I would even say it's obsolete since 6 years.

  • @dimonovych
    @dimonovych 2 роки тому +15

    1. You can write your own function in VBA and call it with "one line of code only"
    2. There are extensions for VBE for additional functionality, such as grouping parts of code.
    3. There is also spell check in VBE, it makes spaces after commas automatically)
    I don't say Python is bad, but those advantages didn't argue me)

  • @logic3686
    @logic3686 3 роки тому +175

    I've already created so many functions/sub routines in VBA that keeps me from writing out common code that writing new subs in my workbooks is pretty simple. Plus I work in an environment where the big factor of installing python on end users computers that use my workbooks is just not reasonable for me. So no, the convenience of VBA being already part of an excel workbook I'm sharing that the user doesn't have to install a 3rd party to use is a big factor for me.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +9

      Thanks for sharing! That is a factor for many people.

    • @rushrush6754
      @rushrush6754 3 роки тому +11

      Your right, python is powerful in data Analytic but can't be compared with vba that was built specifically for Microsoft software. vba is obviously more powerful in excel again python cannot replace it completely

    • @htchd0211
      @htchd0211 3 роки тому +1

      @@rushrush6754 Same here.

    • @wisetank135
      @wisetank135 3 роки тому

      @@Excelmacromastery is Microsoft releasing a MS version of python like script code in excel?

    • @josipsuflaj8371
      @josipsuflaj8371 3 роки тому +3

      @@wisetank135 It seems to me Microsoft is trying to push all to the cloud. M365.No Vba there, not sure about python. All hype about power apps, power automate and powerFX as underlying logic facilitator.
      On the other hand it is still very 'raw' and more bot, teams orientated
      Just my impression. Big companies will be 'nudged' there. Nevermind 'success' of sharepoint that tried that few years ago

  • @JHatLpool
    @JHatLpool 2 роки тому +14

    The big advantage of Excel (+ VBA) is that it is just everywhere. With VBA, you can get started quickly and make a quick assessment of time to be spent/ importance of your proposed application. VBA and Python will live side-by-side for a few years to come.

    • @michaels1813
      @michaels1813 Рік тому +2

      No need to install additional tools. I can be sitting in a meeting and start to code.

  • @PiroMat15
    @PiroMat15 3 роки тому +68

    "Company program restrictions..." That's how my adventure with VBA begins :) And it's great due to easy installation or "no installation needend".

    • @mzucs
      @mzucs 3 роки тому +1

      Same here

    • @joseryanquiatchon7330
      @joseryanquiatchon7330 3 роки тому +2

      Exactly. Develop and throw away

    • @_Dearex_
      @_Dearex_ 3 роки тому

      This

    • @lianvitos
      @lianvitos 3 роки тому +2

      So true. I work in a worldwide operating company and they allow no extra software here. Even Visual studio is forbidden, I have checked today.
      If you request an exception, you are personally responsible for the security of the software. I will never sign that.

    • @petrmercedes1868
      @petrmercedes1868 3 роки тому

      unfortunately also.

  • @Excelmacromastery
    @Excelmacromastery  3 роки тому +8

    You can download the code(both Python and VBA) from the description below the video.
    *Quick note* on the VBA Array code in the video that many have commented on.
    I am aware that I can read the row directly from the range. What I was showing is this:
    Accessing ranges directly in VBA is extremely slow and gets exponentially slower if you are dealing with large data. That's why I use arrays.
    You can write from a range to an array in one line of code. It is fast and efficient. Reading through arrays is also very fast and unlike ranges the performance remains consistent as the size grows(see ua-cam.com/video/JzALsdQvjr8/v-deo.html)
    The problem is that once your data is in the array there is no sort, filter, slice etc. functionality. You have to write your own code to do this. (That's why I created an Array Class - see ua-cam.com/video/ZYxa-Q-nSX0/v-deo.html).
    In Python and Typescript(and most modern languages) it is trivial to do this.
    I see this as a big problem in VBA if you are dealing with large datasets. A new user writes code and it is running extremely slow. They either conclude VBA is slow and give up or they discover that using arrays will make the code much faster. Once they switch to an array they have now lost the range functionality that allows filtering, slicing rows/columns, sorting etc. They then have to write the code to do this or find it somewhere.

    • @Nic_Holas
      @Nic_Holas 2 роки тому +1

      there is no sorting and filtering in python either, it's in pandas library. what stops me from writing pandas for VBA and then claiming it's advantage of VBA. not trying to argue against or for either of the languages, just pointing out that often claimed advantage of python is libraries and those are really not part of the language. a real thing to consider in world of office apps (spreadsheets, small db) is ease of use and overall performance, and VBA wins, and even survives it's owner's intention to kill it.

  • @fischziege
    @fischziege 3 роки тому +55

    Corporate desk slave here: our part time student team member likes to work in Python and his results are great. We as an organisation rely on basic office tools, so deploying solutions as Python scripts or apps is cumbersome and we lack people who can support it. Would love to see Python being integrated in Office, would get me off my lazy behind and learn some more...

    • @jvdb5509
      @jvdb5509 3 роки тому +12

      This is the single reason VBA is still so widely used. I develop in VBA for this exact reason.

    • @johnwayne8059
      @johnwayne8059 3 роки тому +2

      Rather I want to see python integrated everywhere, not only in office products, just BTW! You should kill your lazyness and start as soon as possible with python, caused by python is an allrounder. It's amazingly powerful and can be used for AI as well!
      Beste Grüße 🤟😎

    • @biskutnation
      @biskutnation 2 роки тому +1

      Office script will be available as an alternative.

    • @adastraperlana
      @adastraperlana Рік тому +1

      @@biskutnation 2 words. Monthly billings. Honesty if i were to start a business I would seek of a way to to it exclusively with open-source. If the company gets big, private software will cost you millions per month.

  • @Zavyyn
    @Zavyyn 2 роки тому +11

    When automating and optimizing for others, I find the user wants to open as few applications as possible, leading to preference for VBA as macro/module solutions in Excel and complex Access databases (Especially if those databases already exist). Often, if I consider doing something in Python instead of using VBA it is because it is a one-time task that will not require training somebody.

  • @jimclay4775
    @jimclay4775 3 роки тому +5

    I use Excel and VBA to review geochemical data sets for groundwater monitoring. Recently I have been doing data processing in Excel followed by a handoff to R for data visualization graphics. My data sets aren't big, but they are too large to simply do a visual inspection of the numbers and draw confident conclusions. This video has inspired me to take a look at Python. Thanks!

  • @rahul7rock
    @rahul7rock 3 роки тому +11

    I am using both python and VBA as of now. But will stick to one which you are teaching in near future 🙂

  • @pshamrock787
    @pshamrock787 3 роки тому +10

    I use both. Now that I've learned about the excel wings, I'll use both a lot more.

  • @CodingIsFun
    @CodingIsFun 3 роки тому +33

    Great video, as always! Totally agree with your points. I personally like to use VBA & Python depending on the use case. When it comes to deploying solutions to co-workers, I usually prefer VBA.
    The conversion from a Python File to a standalone executable can sometimes be a solution. Yet, in a corporate environment, mailing .exe is often not allowed.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +1

      Thanks for sharing your experience.

    • @daviddeclercq9998
      @daviddeclercq9998 3 роки тому

      Yes but you can put the executable on a shared drive and run it from there

    • @PeterGeras
      @PeterGeras 3 роки тому +7

      My company blocks mailing .exe as well, so I get around it by zipping the file, then zipping the zip with a password. If the mailing server can't see the contents then it allows it through.

    • @macedoniojr
      @macedoniojr 3 роки тому +1

      @@PeterGeras cool tip!!!

    • @laravelisbullschitt3281
      @laravelisbullschitt3281 2 роки тому

      Most end users are not allowed to install software. Only approved software may be loaded onto machines, usually there is a committee that approves the software that gets on the machines....and it can take YYEEAARRSS for anything to get approved....there are some companies I know who still maintain everyone should be using IE and Chrome / Edge is completely banned. These companies are few and far between now but it is usually the case the larger the company, the slower change will be. The only thing that looks poised to kill VBA is the adoption rate of teams based Office 365 thanks to the fludemic.

  • @excelrobot
    @excelrobot 3 роки тому +28

    Actually, you can do the same thing as results = df.loc[df['Geography'] > 60] in VBA in one line of code if you use Ctrl-T to make your range an Excel table named "marks". VBA would be: results = Application.Filter([marks], Evaluate("marks[Geography] > 60")).

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +5

      Nice - I know there are many ways to filter the worksheet data. Filter and Evaluate functions tend to be slow with a lot of data.
      But what I was demonstrating here was to filter an array rather than the worksheet data. Arrays are very fast to use in VBA but sadly lacking in functionality.

    • @excelrobot
      @excelrobot 3 роки тому +3

      @@Excelmacromastery Since FILTER is one of the new dynamic array functions, it is blazing fast in Office 365. I just did a test with 200,000 records returning 14,000 records in the filtered set and it was pretty much instant (

    • @KaiWeissmann
      @KaiWeissmann 3 роки тому +1

      @@excelrobot Hey, I just tried your suggestion and it gives me an error2015. I have a table named "Stammdaten" with a column "Provisionsanteil". My code looks like this:
      Sub NeuerFilter()
      Dim results As Variant
      results = Application.Filter(["Stammdaten"], Evaluate("Stammdaten[Provisionsanteil]>3"))
      End Sub
      Is there something I did wrong?

    • @excelrobot
      @excelrobot 3 роки тому +3

      @@KaiWeissmann Try [Stammdaten] instead of [“Stammdaten”].

    • @gaitanpol
      @gaitanpol 3 роки тому

      In fact like many coding langage, there as highly specialized libraries / routines that one need to learn to get things done.
      I am not sure the syntax is really what makes the difference.

  • @H270127
    @H270127 3 роки тому +6

    Another excellent video from one of the very best around, thank you so much. So funny because yesterday I finally decided to start learning Python.

  • @derpythecate6842
    @derpythecate6842 3 роки тому +15

    Not for malware. VBA is still really handy for executing code on unsuspecting victims via macros.

  • @SolidSnake59
    @SolidSnake59 3 роки тому +22

    I would love to see your video where you teach Python!

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +12

      I may do more in the future.

    • @TheMcHonky
      @TheMcHonky 3 роки тому +1

      @@Excelmacromastery That's really another strength of Python. The amount of quality learning material, especially for getting started with Python - Corey Schaefers channel is my favorite. For Excel - well there is this channel :-) which is awesome, but in general there is not that much out the for improving VBA skills.

    • @danielcook1271
      @danielcook1271 3 роки тому

      @@TheMcHonky this 100℅!! I'd love to master vba but can't find enough decent materials. I've a number of books but they more show you what you can do with vba rather than teaching it.
      Whereas Crash course python is just an amazing introduction to python

    • @johncheung4905
      @johncheung4905 3 роки тому +2

      @@Excelmacromastery Please do. Your explanation is superb.

    • @johncheung4905
      @johncheung4905 3 роки тому

      @@danielcook1271 I learn by doing. I suggest you try this way too. Think of a problem, real or imaginary, in Excel. Then begin writing code for solving it. Whenever you are stuck, search the internet for the solution. You will spend a lot of time in the searching and testing out which solution works best, but this experience will prove very useful.

  • @Malignvs
    @Malignvs 3 роки тому +9

    VBA gives you the ability to troubleshoot the running code line by line with F8, breaks points and dragging the resume point at will. This is really powerful, especially when you're dealing with 100's of lines of code in one module.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +3

      You can debug Python code.

    • @Malignvs
      @Malignvs 3 роки тому +1

      @@Excelmacromastery Can you do it in a similar way, though? I only wrote some code in IDLE, and didn't see any options to do it.

    • @johncheung4905
      @johncheung4905 3 роки тому +3

      @@Malignvs I am a beginner at python too, but had a lot of experience with VBA. VS code can do debugging similar to VBA, ONLY if you add breakpoints to the lines of your code where you want to pause. Then you press F5 to proceed from one breakpoint to another. You can add the variable you want to check by putting it into the WATCH list.

    • @MatthewTaylor86
      @MatthewTaylor86 3 роки тому +3

      @@Malignvs Debugging Python with VSCode is pretty similar to doing it in VBA! You can see all the local variables, you get an immediate window, etc, plus lots of nice extras like updated locals being highlighted and seeing the values in the code itself.

    • @Malignvs
      @Malignvs 3 роки тому

      ​@@johncheung4905 ​ @M Taylor Thanks for the explanations! Still, it looks like you can't go line by line (which helps tremendously) without inserting the break points yourself. However those break points should suffice in most cases. :) I need to familiarize myself with VSCode. :)

  • @richardgilbert9042
    @richardgilbert9042 2 роки тому +19

    Python has some of the same advantages as R, but there's a lot more to Excel applications than just a little data read/filter/write. I have written apps in VBA that dynamically modified the UI in Excel, changing menu options based on queries that are based on initial user selections. The user then made additional choices from the dynamically populated lists, and those choices were used to build SQL strings, query an external DB, process the query results, and populate reports and charts in the workbook. Complicated? Well, yes, but I wouldn't have wanted to try it with Python. All the necessary code and structure was encapsulated in the saved Excel workbook without 3rd party appendages to be installed/managed. Power Query wasn't available back then, but I'd probably look at integrating that with VBA in the applications I wrote before messing with Python/Excel hybrids.

    • @Deepanshu302
      @Deepanshu302 Рік тому

      Can you teach me VBA. With real uses.

  • @thecodfather7109
    @thecodfather7109 3 роки тому +57

    Exactly the video I needed

  • @alanhood9675
    @alanhood9675 3 роки тому +8

    For me it was, " Is it worth learning VBA ,to do something that python can do just as well (or better) ,when I want to learn python anyway". You convinced me, I'm doing it in python!

  • @NZBruceman
    @NZBruceman 3 роки тому +2

    Thanks. Great summary. My company sells Excel tools that integrate with Oracle EBS, mostly in the US. We have employed VBA now since Excel 97 and there are up to 50,000 lines of code in some of the tools. Never underestimate the reluctance of IT to install stuff on their networks/PCs. Having VBA available without an install has been an incredibly important advantage. We have new C# based software creating an Addin and the install is a new barrier we have to fight to overcome, every single time. VBA will never die. Look what happened to Microsoft when they dropped it in Office 10 for Apple! They were burned.

  • @moekyawthu8861
    @moekyawthu8861 3 роки тому +7

    I leraned a lot from u. Thanks a lot.
    Now I use Excel VBA for details process in Excel. Python for other general things.

  • @sparetheearthlings
    @sparetheearthlings Місяць тому

    Excellent video. Thanks for breaking this down. Was curious what the pros and cons of both were and this answered my questions!

  • @Thunderin11
    @Thunderin11 2 роки тому +22

    Very interesting video. But... As a VBA die-hard who has been making a living out of it for almost two decades, I have to shout out loud that VBA is here to stay! Maybe Python has some advantages when it comes to analyzing data but VBA is used for much more than analyzing data. It is used most commonly to automate Excel and other Office software. It was not referenced in the video how easy / useful it is for Python to automate Excel environment objects for instance (e.g. charts, shapes, pivot tables and list objects). This debate "Will Python Kill VBA" reminds me how in Excel forums between 2010 to 2012 people strongly argued that Excel would disappear soon because Google Sheets is potentially a much more superior product to Excel. Well reality proved it otherwise. Today Excel is by far the most superior spreadsheet product without any competition whatsoever in sight.

    • @alfredoprime5495
      @alfredoprime5495 2 роки тому +1

      I agree completely. Data analysis is secondary for what we use Excel at work. Charts, pivot tables, regular tables, userforms, custom functions, events,... the list goes on.

    • @MrAbrandao
      @MrAbrandao 2 роки тому

      I use Excel VBA to automate web pages. But now I am stuck with the dead of Internet Explorer....

    • @TheStenius
      @TheStenius 2 роки тому

      We all know it: in most companies, you are considered the (only) „Excel-freak“ in the team if you mention your VBA-skills. Some people even still don‘t know what VBA is. My Boss, Professor/Director of a big science institute, never heard if it. That are the people you have to design your xlsm-files for in many cases. For some of them, it‘s a challenge to make those small adjustments on their Excel to run all of those files. Now we shall ask them to set their systems up to enable Python-code in Excel? Haha, good joke. I would change right away, if MS would implement Python to MS Office. But since that will never happen…

  • @duncanmorrison9860
    @duncanmorrison9860 3 роки тому +5

    Great video
    Please more videos on Python with Excel.

  • @NTT-ShortStories
    @NTT-ShortStories 2 роки тому +2

    My company puts hard restrictions on any software that is excluded from the acceptable software list which is provided by IT Dep, so that if I (maybe anyone other than me) want to use python instead of VBA then I need to take some approval from IT department (very very hard to get it). Even MS Access is not accepted for my department, and MS Office Suite only contains 4 applications: Excel, Word, Powerpoint, Outlook.
    So in my opinion, Excel VBA is the best stuff for data manipulation in office environment. I totally agree with Paul.

  • @krisvantuerenhout537
    @krisvantuerenhout537 3 роки тому +7

    Once Python will be installed on as many machines as Office , it will take over i think. For IT people for sure. For NON-IT people i don't think so (not yet). Recording a macro is so easy for the majority of tasks you want to automate. Far from optimized code , but it gets the job done.

  • @gregorymathy2782
    @gregorymathy2782 2 роки тому +9

    Both are fine for me it depends on what you need to do. Pandas is a great tool that’s being said excel can be seen also as a ready to go graphical interface. whereas in Python you also need to create it … so my dream would be to get a more dedicated Python integration with excel and MS office that would be so great …

  • @ChristianBeringer
    @ChristianBeringer 3 роки тому +6

    One thing was missed out: Big Data and Machine Learning and connection to database-servers.
    VBA is quite useless for ML or big data analysis in databases, while Python offers many libraries for machine-learning, computer-vision, simulations and even 3D-data visualisation.

    • @sandragrushoff9844
      @sandragrushoff9844 2 роки тому +1

      yes - but ML is big data not real learning. Show an amoeba enough pictures of a cat and it can do the task. ML is interesting but it's not learning or intelligence or with the whole world networked the singularity would have blown us away by now.

  • @chanchalraj2592
    @chanchalraj2592 3 роки тому +27

    Please start teaching us to Python... Thanks P.Kelly

  • @barttitulaerexcelbart9400
    @barttitulaerexcelbart9400 3 роки тому +12

    Thanks a lot, really interesting. I would love to see a video where you compare power query with python. I would also like to see some real live cases where Excel reaches its limits and Python can take over..

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +8

      Great suggestion!

    • @justinlee9789
      @justinlee9789 3 роки тому

      Time series analysis. For instance how do you make a rolling covariance matrix? Doing it with excel will cause a dimensionality nightmare

    • @macedoniojr
      @macedoniojr 3 роки тому +1

      Simple example (not real python fan yet): Python can read 2GB csv file with millions of rows. Excel will load 1mln 48k rows and cut off the rest or throw error....

    • @barttitulaerexcelbart9400
      @barttitulaerexcelbart9400 3 роки тому +2

      @@macedoniojr with power query in Excel this is not an issue

    • @alexaneals8194
      @alexaneals8194 2 роки тому

      @@macedoniojr In reality if you are doing that type of work in Excel then you are wasting your time. A relational database can handle that data a lot quicker and with more efficient results. You can use Excel as a frontend and have the database do the grunt work.

  • @simonghislain
    @simonghislain 3 роки тому +5

    I had 3 moments during which I was like "yeah but then you would need to do this" and then you immediately talk about it. This shows your great mastery on the topic. I completely agree with your conclusions. Thank you for this video !

  • @elicesroman7500
    @elicesroman7500 3 роки тому +5

    Thx Great video. The problem with python is that commercial organization refused to install open software because it is not supported. In terms of efforts - rewards I think that python is much more better than VBA Excel. I think with a few hours of coding python will allow you to do much more than VBA Code.

    • @shehab976
      @shehab976 2 роки тому

      I think they know python as snake rather than a programing language😁

  • @edudecnop
    @edudecnop 3 роки тому +1

    I didn't know Pandas was able to read and write in Excel files, that's good news for me. I tried to include an add-on for python application in Excel in the past (don't recall which one), but it let the program quite slow, so I gave up trying to use them together. I'll rethink about this possibility in future soon. Thanks for the video!

  • @coffe4wolf
    @coffe4wolf 3 роки тому +15

    Python will never replace VBA. There are too much cases when you cannot install new software (due to IT policy, security rules, etc.) but excel and VBA exist on almost each PC with Windows

    • @luckyea7
      @luckyea7 3 роки тому

      согласен!

    • @BrianBattles
      @BrianBattles 3 роки тому

      True

    • @boschmitch
      @boschmitch 3 роки тому +1

      Python ALONE would not replace VBA perhaps. Its the entire cloud or hybridize cloud would remove the feasibility of running codes on PCs. For medium to large companies, using excel is a decrease in productivity. You get data from server, manipulate it then analyze. Why not do it on the source (server-side)? For small companies, cloud equivalents or even Google Sheet can do without installing anything. Most company can survive without Excel tbh (our do). As a bonus of server-side deployments, you can run these in any OS flavor you want.

    • @coffe4wolf
      @coffe4wolf 3 роки тому +1

      @@boschmitch I'm agree at the point of using cloud tools, but there are a lot of cases when excel/vba still useful in big companies. We use VBA to automate a lot of processes in SAP which could take a lot of time to do it manually and too expensive to handle it with ABAP-developing.

  • @goombakiwi
    @goombakiwi 3 роки тому +2

    I've written VBA for some time. My experience shows that some companies are already apprehensive about allowing employees to use the available VBA. I had one employer disable access to macros, until they realized our ADI's were dependent on them. Staff are generally not hired for programming skills and the push to construct workbooks for basic excel users will continue to be prevalent.
    With increased cloud usage and SharePoint; MS appears to be focusing on Typescript(Javascript). The prospect of bringing on an enterprise application for Python; is not promising. The recent ransomware news might further diminish employee access to automation features.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому

      Thanks for sharing. You make some interesting points. TypeScript has still a long way to go to compete with VBA and it's not clear if that is Microsoft's aim.

  • @ymlaos9850
    @ymlaos9850 2 роки тому

    I have stopped using Excel for 2 years now. Managed to exit gracefully and use python for doing my LET. L=Load (MBs of csv

  • @Dabayare
    @Dabayare 3 роки тому +1

    Shocked to see if VBA is still around. Must b nice working for bigger companies. Never seen it in the small niche companies I been working with over the years

    • @tumtum6910
      @tumtum6910 3 роки тому

      Yes there are corporations which use VBA and they don't know python...😔

  • @toddbrannon6262
    @toddbrannon6262 3 роки тому +2

    Excellent video!
    I work with a team that develops tools in Excel and Access. VBA and SQL are king (and queen, I guess?). There has been some discussion about using Python, but it becomes an issue of support. I am the only one on the team with any Python experience and if I were to leave, they would be forced to backfill with someone who has Python experience.
    The elephant in the room is that Python does not come preinstalled on Windows machines like it does on Mac machines. This is a huge problem and some of the comments here have already mentioned this. Until that happens, if ever, I think you will see adoption of Python as an alternative to VBA be painfully slow - at least within companies that use VBA like mine does.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому

      Thanks for sharing Todd. You make a very good point.

    • @Moh23Moh
      @Moh23Moh 3 роки тому

      can you make a vba code that open the browser and go to a page
      reads a captcha fill it in a text box in the web page and press enter
      and the code should work at a certain time

  • @anishpillai
    @anishpillai 3 роки тому +1

    My workplace uses excel extensively. And we had developed so many VBA applications over 5-6 years. Once we switched to python, an entire new world was unlocked. We have used async, pandas, django, openpyxl, sqlalchemy, pysimplegui and so many other libraries in python which makes our developers life so much easier. Yes VBA definitely has its benefits and there are some shortcomings in python, but the benefits of python massively outweigh the shortcomings, atleast for my workplace.
    Also most of the comments mention about installing python for end-user, but we have never done that. We use pyinstaller to generate executable codes that needs no installation for end-user. And it runs on any pc just as it does on my computer, without having to install anything for others.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +1

      Thanks for sharing Anish. Great to hear your experience of using Python.

    • @anishpillai
      @anishpillai 3 роки тому

      @@Excelmacromastery thank you for the great video

  • @andy.1331
    @andy.1331 3 роки тому +3

    To use VBA with Excel all you need is just Excel: no additional IDE (+1), no additional components (+1) - totally +2. Using Python for Excel: additional IDE & components - totally -2. This is very important in case you deploy your project to any customer (inside your company or outside it) - no additional prerequisites and maintenance fees. I don't see any reason to replace one scripting language with 2 plusses with another one with 2 minuses. Actually, higher performance of Python with Excel could give it a huge plus. But author don't take it in a count, because, highly likely, there is no such a difference in their execution performance. So, Python or VBA - is just a matter of a personal preferences (except if your boss is a fan of Python :-)).

  • @dh8203
    @dh8203 2 роки тому +1

    Python looks great, but VBA comes integrated in Office. Your conclusion does a great job of laying out why many people, including myself, won't be switching to Python any time soon. I create things for other people to use, it can't require them to set up Python and then fail when they move to a new machine, or re-install Office.

  • @mzucs
    @mzucs 3 роки тому +3

    In a spreadsheet scenario Python can be simpler to learn algorithm and deal with Big Datas, but VBA it is not as bad as people say, It is just need a good update. By the way, in an office environment if you aim for automations and optimizations, mainly for daily tasks and for other people to use, then go VBA. It is way easier to create a simple, useful and visual application and send to other people.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +1

      That's for sharing your experience Matteus.

    • @ichbrauchmehrkaffee5785
      @ichbrauchmehrkaffee5785 2 роки тому

      VBA isn't easier, it's just allready integrated,
      whereas in python, you currently have to connect to Excel from the outside
      (and you don't get autocompletion because of that)

  • @davecks3042
    @davecks3042 3 роки тому

    Brief and concise is your explanation in a single short video . Thanks

  • @SimpleExcelVBA
    @SimpleExcelVBA 3 роки тому +2

    I thought than after VBA I will go into the TypeScript direction, but now I should also consider Python.

  • @1612ganesh
    @1612ganesh 3 роки тому +2

    Really you are awesome. I watched your all videos and learning VBA.

  • @g07denslicer
    @g07denslicer 3 роки тому +3

    4:26 wait a minute, you just have to supply the sheet to it? You don’t have to specify a region?
    What if there’s an unrelated table off on the right of this one?
    When you tell python to print the 3rd line, will it print the results of the grades table, a bunch of blank spaces, and print the same line of the other table?

  • @sinus2220
    @sinus2220 3 роки тому +1

    Fantastic video! I'm currently in the process of automating not only excel spreadsheets but also web and file operations at the same time. Granted, you can do all of this with Excel and relevant reference libraries, but it seems Python would be more robust and flexible. Most probably I'll be using both in conjunction :) I hope VBA will remain popular forever as I like this coding language very much. Thank you for putting all of the essential information in such a concise yet very informative clip!

  • @wsross3178
    @wsross3178 3 роки тому +1

    I used to work with vba due to installation restriction. Later on i get to work for excel reporting from unix server with built-in python. I get green light from the IT security to install pandas offline and it really replace a lot of manual spreadsheet process.

  • @Unchained74
    @Unchained74 3 роки тому +2

    Great video. Right now python is my favorite language. I'm still a newbie, but its actually pretty amazing to see the things you can do with it. I'm trying to get to where programming in python is just natural.

  • @Mandelbrot567
    @Mandelbrot567 3 роки тому +6

    Excellent information, how about a comparison of python vs typescript for excel?

  • @iljunjang
    @iljunjang 3 роки тому +7

    Thank you for the great video, always great content. 2 questions: 1) isn’t VBA much faster to run than Python for Excel programs? 2) Also, doesn’t VBA give us much wider library of Excel objects (such as conditional formatting), at least so far?
    I build enterprise VBA apps and I’ve felt that coding in Python (and JavaScript also) is inferior for speed and control, though I could be wrong. Wud appreciate your opinion.

    • @ichbrauchmehrkaffee5785
      @ichbrauchmehrkaffee5785 2 роки тому

      Those Excel Objects you're talking about have nothing to do with VBA but with the Excel API-Object.
      The thing is, VBA is fully integrated in Excel with its own editor that can access the API-Object and thus the Excel-library,
      whereas in python, you need to connect to it from the Outside.
      But that would (hopefully) change, if MS were to implement Python in their Office products.
      But I think even more important would be an Update to the VBE-Editor...that thing is just a PAIN in the nuts to work with..

  • @cuejorge2003
    @cuejorge2003 2 роки тому +1

    I totally agree with you. VBA is part of Excel and those of us who have used it for many years, as you said, we already have written codes that will not work if VBA is eliminated

    • @milesdedrick4632
      @milesdedrick4632 2 роки тому

      Well that's actually part of development. As languages depreciate in value and newer ones start to replace them it warrants a rewrite/recode

  • @Daekar3
    @Daekar3 7 місяців тому

    I'll agree with the other commenters, the biggest advantage of VBA is distribution. Users have Excel and are familiar with it. No additional installs are required. They access one file and it just works.
    I would consider Python or something else if there weren't distribution challenges associated with them, but embedding VBA in our controlled documents is a no brainer.

  • @michaels1813
    @michaels1813 Рік тому +1

    For the work I am doing VBA is simple and gets the job done. Having to install Python would result in having to setup another tool. For now I will stick with VBA.

  • @Freddyhb1
    @Freddyhb1 2 роки тому

    This is the best video I've seen on UA-cam on Py vs VBA

  • @BrianGallagher
    @BrianGallagher 3 роки тому +11

    I started using python because the tables of data I was working on were 2.5 - 3 million rows. That's a massive benefit python has over excel. I found the learning curve to be far easier than VBA - python is much more intuitive. For installation purposes, the Anaconda environment is an easy starting point for new python users. Numpy handles calculations on large arrays effortlessly, so enriching data is simple. I still use excel, but I now always do the heavy lifting with python.

    • @evgeniy19
      @evgeniy19 2 роки тому

      You can use Power Query and Power Pivot to work with millions of rows effortless. They're a bit harder to master, but already built in Excel, which has several benefits.

  • @reng7777
    @reng7777 2 роки тому

    1 year later.. i AM watching again this video and now makes more sense why Py will be the #1!!

  • @ChillGuy511
    @ChillGuy511 Рік тому

    Not even 2 minutes in and already subbed!

  • @FizzyMcPhysics
    @FizzyMcPhysics 3 роки тому

    This is exactly what Ive been wondering for a while! Thank you!

    • @FizzyMcPhysics
      @FizzyMcPhysics 3 роки тому

      This was really useful, thanks! I'm one of those people who makes macros in a large organisation. While I'm sure everyone could install Python on their laptops, it's just not practical to get them to do it and maintain it. Also, my code resources and knowledge are so mature now, I'm just too invested to make a change worthwhile. I'd also have to use a mix of Python and VBA to do things like formatting and emails.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +1

      Thanks for sharing Benjamin.

    • @FizzyMcPhysics
      @FizzyMcPhysics 3 роки тому

      @@Excelmacromastery After talking to a colleague, I think it should be seriously asked if Alteryx will kill VBA in the near future. I'm seriously afraid of Low/No Code solutions taking the spotlight soon.

  • @sethnielsen3325
    @sethnielsen3325 2 роки тому +6

    ”Python is so powerful and can does all this with just one row”
    Well yeah that’s how functions work. Sorta cheating if you call a function “one row”

  • @tumtum6910
    @tumtum6910 3 роки тому +9

    I personally feel that it is easier to use python with excel files. Many people don't realise it...

  • @MrMSS22
    @MrMSS22 3 роки тому +1

    The only reason why python has’t replaced VBA completely is that too many people have been using VBA and it works sufficiently for many problems. It’s the same kind of people that have opposed against computers bc they feel uncomfortable with it for being something new. The video underlines the inferiority of VBA. If companies focused less on short-term success, python would be the standard today.

    • @TimTheMusicMan
      @TimTheMusicMan 3 роки тому

      Well for the examples you showed here, you don't really need VBA at all. You can simply use IF, MATCH, VLOOKUP to extract data, you can use conditional formatting and then there is the option to record VBA. In many cases for data analysis, you don't need VBA at all. The functions are so powerful. If you compared pivot tables to python as another example you can simply build a pivot table in minutes with no VBA compared to doing the same in python, python cannot compare.

  • @philaman1972
    @philaman1972 Рік тому

    The advantage of VBA is that company departments can create something "quick" and "dirty" without need of oversight from IT. For example, if I am a manager and want to report on turn-around-time metrics to show my boss how well my team is performing, I can quickly put together a GUI using MS Access/Excel and write some code in VBA to do it.
    I think the above reason is why Microsoft has decided to keep VBA; the use-cases for it remain too valuable to discount!

  • @peterlilley6819
    @peterlilley6819 3 роки тому

    Great video Paul, I had been evaluating this myself, I had heard, but not qualified that Python was significantly slower than vba at runtime.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому

      I haven't done any benchmark testing yet so I can't say for sure. For the Filter task in the video it does run slow compared to VBA.

  • @kelvinteoh9058
    @kelvinteoh9058 2 роки тому +1

    I felt that the example used in this video could have easily been performed using formulae rather than vba which is what I do these days because vba requires troublesome signatures from our ICT security department on my company laptop. The main reason I have used vba was if I needed to execute event based calculations or actions which formulae can't. In fact, because vba is quite inefficient in some aspect of interchanging data, I tend to use a worksheet as a form of registry to keep the last known dataset rather than keep it as a variable in code. My question to this longwinded comment is whether the Python add in is capable of these. Thanks.

  • @zzzzzzzzzzzzzzzz9
    @zzzzzzzzzzzzzzzz9 3 роки тому

    Nice video. I'm a heavy user of excel and I'm not very good at VBA, but i learning it. However, this video has got me thinking about switching to Python. The disadvantage is as you stated, installing the application on my work laptop

  • @Yalali1
    @Yalali1 Рік тому +1

    With the recent announcement of Python in Excel, is it safe to assume that VBA is now redundant if someone can use python instead?. an update to the video with the new python feature would be appreciated.

  • @sandragrushoff9844
    @sandragrushoff9844 2 роки тому +5

    Intresting vid - I'm a VBA programmer, among other languages, so i've got most of this pretty quickly. I think the main take away point is Python integration, which I think may get rid of VBA (eventually). Otherwise it's just a library. Not only that I can shell out to exe files i've created in another language, or write to an ini set of instructions then do the same. Ultimately Python (in context of VBA) is little more than another library, and there's a lot of libraries, including access to the windows API where I think a lot of power lieth. I'm interested enough to take this seriously though especially as I think everyone will need Python eventually. Moreover - if VBA is rich Italian, Python and others are barked military instructions in a very accurate manner, a far more limited lingo for arguably greater function. VBA programmers may lament the fact they've learned zillions of commands! I'd also be interested to know about the advanced "big data" applications. VBA can do everything in this video and greater. So i'm guessing that if you import 2 million cells and start zooming over them in Python, then VBA may be a frozen spreadsheet and the other may be a quick but two step process then a populated spreadsheet. Cheers for the vid.

  • @24Boli
    @24Boli 3 роки тому +2

    As usual, fantastic video! I guess that Python won't be able to "kill" VBA in a short term, but eventually is likely to do so

    • @excelrobot
      @excelrobot 3 роки тому

      Before VBA was XL4 macros, and they are still supported after being replaced by VBA almost 30 years ago. Even if Python or TypeScript replaces VBA, it will live on for another 30 years from now.

  • @changnoiboi
    @changnoiboi 2 роки тому

    Excellent, thank you Sir.
    Just getting into VBA & Python and this has helped guide me to my next learnings

  • @FernandoRamosOstroswky
    @FernandoRamosOstroswky 3 роки тому +2

    hello from Brazil !!!! Thank you for amazing videos that you posted. It's a hard decision for MS to integrate the phyton to VBA, because they created the typesript, but... It's a question of time, I think...

  • @agnvstosantras8599
    @agnvstosantras8599 3 роки тому +3

    It is easy to build some classes in VBA to do what you show with Python. You didn't show that Python is better than VBA but you said that someone can find Libaries (to import) in Python for better work.

    • @Sancarn
      @Sancarn 3 роки тому +1

      And similar libraries exist for VBA. Realistically, they are pretty equal. The only benefits shown are use of VSCode, which you can also use to code VBA :)

  • @Ashish-2319
    @Ashish-2319 3 роки тому +2

    Great explanation sir. Indeed you have cleared many doubts.❣❣

  • @edrobinson8248
    @edrobinson8248 2 роки тому

    I had to stop this video half way to break off and tell you how taken aback I am. Enlighteneing and Very well presented.
    Thanks (VBA author)

  • @charlesbyrneShowComments4all

    The issue is whether or not the application will be used by users that cannot automatically install a 3rd party library on their PC due to company policy or antivirus/anti-malware software. If the use case was for a researcher/engineer/power user that had full control of their workstation it isn't an issue. If the PC is locked down then it may be easier to distribute as xlsm with some type of app launcher versioning process especially if it is going out to a few hundred users. If there is a portable python runtime library that wouldn't get blocked and treated as malware then that would be an easy deploy option. Otherwise, it's just easier to do VBA.
    Based on what you have shown me in previous tutorials with Panda, Pyxl and xlwings I do see a great opportunity and better options for both Excel and OpenOffice spreadsheet automation solutions with larger datasets from various sources.

  • @fixmaster6956
    @fixmaster6956 Рік тому

    I think the biggest advantage VBA has is the ability to share it to other colleague, imagine you in a coorperate company, and u want to make certain task as aumated, if using python, you either need to ask them to install python themselve or install the exe that you make, for excel you can just create and share, no setup whatsoever from the user

  • @vxsniffer
    @vxsniffer 2 роки тому

    Microsoft has employed Python's creator Guido van Rossum in 2020 hence many options are possible in the future, including Python scripting inside Office.

  • @ionblaster7432
    @ionblaster7432 3 роки тому +1

    Would love a video series teaching python

  • @DanielADamico
    @DanielADamico 3 роки тому +1

    My opinion: I think that a more realistic scenario is desktop applications like excel being gradually replaced by their online versions. Excel Online is getting better and better and I think that Office Scripts (that runs only on Excel online) will eventually replace VBA because there will be no need to have the Excel Desktop installed anymore.... but this would take some time of course...maybe 5-10 years ....

  • @TheRealMake-Make
    @TheRealMake-Make 3 роки тому +3

    Rather than Microsoft purchasing Python, why don’t they simply incorporate the best of Python into VBA? The steep learning curve, time-consuming organizational software installation, user privileges, IT regulations...Python is simply too expensive as an organizational tool (for now). The code is beautiful, though-this was my first glimpse of it!

  • @wayneedmondson1065
    @wayneedmondson1065 3 роки тому +1

    Hi Paul. Thanks for the view of Python with EXCEL. I've tinkered with it in a small way, but VBA (and Power Query) can currently handle the things I need to automate. Probably, that is true for many people. But, you never can discount an alternate way of getting work done. So, worth keeping an eye on the options (Python, Office Script, etc.). As always, thanks for your interesting perspectives and insights. Thumbs up!!

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +1

      You're welcome Wayne. Definitely a lot of options nowadays.

  • @arav8431
    @arav8431 2 роки тому

    Great explanation, please upload python with excel manipulation more videos 👍👍

  • @AndrewB_NNA
    @AndrewB_NNA 2 роки тому

    OK I have no idea what you are doing in that first VBA example but literally all you have to do is this:
    1. format the table as a table and give it a sensible name, I named my "data". (you don't even have to do this)
    then do this
    For Each r In Range("data").Rows(1).Cells
    Debug.Print r.Value
    Next r
    3 rows, thats it. Or am I missing something here? I haven't tested the speed, this approach might be slower but I usually don't work with such huge data sets that speed becomes an issue for me.

  • @davidlazarus4198
    @davidlazarus4198 2 роки тому

    Like the video. The fact that Microsoft have brought Guido von Rossum out of retirement (inventor of python) should give some indication of where Microsoft intends to go in the future.

  • @kevincen5727
    @kevincen5727 3 роки тому

    Over last cup of years, with Python i have written applications to manipulate data in excel and automatically do things on website, google maps, office 365 and so on. I also used VBA few times when i just need some quick and dirty stuff to be done in excel alone when formulas are not enough. I guess the biggest problem with VBA is that all you can do stays in the realm of Excel, or Microsoft suite at most, while with python there's much more potential. I don't use the "record macros" that often as i can get solutions easily from VBA documentation or just stackoverflow. But i guess if you are beginner to coding then start with VBA is a good idea. Meantime always keep an eye on Python if you want to link your spreadsheet with other part of your process.

  • @elegantgrasshopper1060
    @elegantgrasshopper1060 3 роки тому +1

    Your videos are just wonderful. Thank you so much.

  • @praveenthankappan6900
    @praveenthankappan6900 Рік тому +1

    I would say there is easier code in VBA to achieve what you chose as an example. May be the example chosen was wrong. No doubt that Python is much more stronger than VBA, in many aspects, including the stability of the code and application as well.
    One thing you may not have considered is the easiness to use. For a small repetitive data manipulation/formatting, even a non-programmer could do it with the help of macro recording and power query in excel while it needs some learning to do the same in Python.
    My verdict is VBA will remain for some more time and even if it is killed, may not be because of Python.

  • @nick9198
    @nick9198 2 роки тому +1

    bro you are like comparing spoons and warthogs right now

  • @randybobaby86
    @randybobaby86 Рік тому +1

    The frustrating part is that most companies won’t let users download python on a work machine.

  • @pop2mcar
    @pop2mcar 3 роки тому +1

    I use python when I have to search through 100s (sometimes 1,000s) of files, make column changes, etc. It works great!

  • @voilin
    @voilin 3 роки тому

    I thought it was a shitpost video. Actualy learnt something

  • @georgepapadopoulos8454
    @georgepapadopoulos8454 Рік тому +1

    I don’t think that VBA and Python are comparable. I’ll use VBA for MS Office tasks and I’ll check if I can use Python for other programming needs

  • @yeoyinghui
    @yeoyinghui 3 роки тому

    Very good comparison. Will love to learn from you too!

  • @Kart-Zero-1
    @Kart-Zero-1 3 роки тому

    You can use PowerShell to access Excel/Office via Com Objects, and it's found everywhere Windows is installed. I'd like to see Office natively support development in PowerShell given it's easier to write than VBA and also a Microsoft technology.

  • @robertwoodman738
    @robertwoodman738 2 роки тому +2

    You make excellent and convincing points for why Python is important and could (perhaps, should?) be part of any extensive Excel development. However, my employer doesn't want me to install or use anything outside of the Office environment. They have several reasons, none of which are essential to this discussion. The bottom line is that any development work I do for my employer must be done with whatever installs with Microsoft Office and works inside the Office environment. That means I must use VBA and not Python.

  • @shashivishwakarma6302
    @shashivishwakarma6302 3 роки тому

    Thanks kelly exactly I needed please make more videos thanks a lot

  • @david_apraiz
    @david_apraiz 2 роки тому

    Thanks for this very instructive video!!

  • @philipmcdonnell7168
    @philipmcdonnell7168 3 роки тому +6

    I'm interested in Python but I still think MS will continue to push Typescript.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +3

      I don't think TypeScript is set to be a replacement for VBA. Microsoft have said "VBA isn't going anywhere" and TypeScript only works online and with Power Automate at this time.

    • @mzucs
      @mzucs 3 роки тому

      @@Excelmacromastery TypeScript is now in Online Excel as well.

  • @ahrorkuldashev9603
    @ahrorkuldashev9603 3 роки тому

    Really appreciate your time and effort to create this great educational video.