Category: VBA \ Excel

VBA is not a scripting language… Not at all!

Dot Product in 2D with Python

Talking about dot products in linear algebra can be really a subject of hours, but long story short this is probably the minimal knowledge you can live with: The dot product (inner product) is an operation on 2 vectors that

Tagged with: , ,

VBA – Array to Excel Range. With filtered rows.

Excel with VBA is really a powerful tool. There should be some 5 more years, until Python really becomes a standard for the Excel people and I am not sure that it would actually happen that quickly. Anyway, working with

Tagged with: , , , ,

VBA – Excel Range to Array

The Castle of Mezdra

In the last weeks, I have noted that one of my answers in StackOverflow has received some upvotes. Which was somehow strange, as people keep on telling me that #VBA is going to die and it is a “funny scripting

Tagged with: , , ,

Simplifying Excel Tasks with Python: Data Handling and Testing Tutorial

Working with Python and Excel is actually quite handy, especially if you are into it. In this article, you can see how to create Excel files, write data and formulas into them and read these. Pretty much simple CRUD methods.

Tagged with: , , , , , , ,

Python – Make a simple API with Flask and Postman

Flask is actually really a powerful tool for making an API. In the video below, you would see how quickly I am building an API, that does four really simple functions. The functions are – saying “Hello”, multiplying a number by

Tagged with: , , , ,

Python Dictionary – Advanced. With YouTube video.

Some time ago, I wrote an article about defaultdict  in Python here – vitoshacademy.com/python-defaultdict-object-or-how-to-avoid-the-key-error. Now, I have decided to make a video about it and increase the scope with standard dictionary functions and an advanced class, that checks whether the

Python – Lambda Expressions – With YouTube Video

As one of the acknoledged reviewers of the Manning book Python How-To, I have decided to make a YouTube video, based on a part of the book, mentioning Lambda Expressions. The video is here, and the code I have used

Tagged with: , , , ,

MS Word – Connect a connector to a Shape

Have you ever got your connectors in MS Word not in line? Like this one: The good and intended way to do it, was pushed by Microsoft some time ago – go buy yourself MS Visio. But, if you do

Azure – Quickstart: Deploy a Pyton Flask web app to Azure App Service – With YouTube Video

Following the step-by-step original tutorial here, I have created a simple Azure video tutorial, explaining how to deploy a python flask web app with local git. The idea to have something on your own PC and then simply using this

Tagged with: , , , , ,

VBA – Check if resource or url exists in the internet

If you are one of the many VBA developers, then most probably you have been asked once or twice to download some file from a local eshare or site. Before downloading it, it really makes sense to check, whether this

Tagged with: , , , ,

VBA – Insert Into String

Inserting into string in Excel should be a trivial task, but it always makes sense to have something prepared in the boilerplate, before you start working. Ok, why is it important to have a nice function, if something like this

Python – Write a DataFrame or List to multiple tabs in Excel

The idea of the article is to provide a Python code that does the following: Takes a list or DataFrame; Splits it into quite a few smaller parts; Writes each one on a separate Excel worksheet; Pretty much like this:

Tagged with: , , , , ,

VBA – Split worksheet to worksheets, save Excel worksheets to csv

Same article, but for Python is here – https://www.vitoshacademy.com/python-split-worksheet-to-worksheets-save-excel-worksheets-to-csv/ This article does 2 things: Splits one worksheet to multiple worksheets Then goes through the worksheets and saves them as *.CSV files I hope that is enough for you. Ok, so

Tagged with: , , ,

VBA – Option Compare (Text || Binary || Database)

Option Compare  in VBA is the thing, that will save you ugly stuff like this one:

Yup, it is a bit ugly, using UCase  to compare all the time, between small letter text and big letter text. So, if you

Tagged with: , , , , ,

VBA – Get Substring Between 2 Substrings – Locate value of Nth XML

Getting N-th string between two substrings might sound a bad idea, until you do not need it. And with VBA, you better have something prepared. So, imagine the following XML (from this article here):

Your task is to get

Tagged with: , , , , , , , ,

How to get redirect url using Excel VBA or Python

Getting some tiny URL, that redirects you to somewhere else might be dangerous. There are a lot of people, that would never ever click on bit.ly/something or goo.gl/something, just because they do not know where the redirect is going to

Tagged with: , , , , , ,

VBA – VLookup with Multiple Criteria in Excel without Excel Formula but with VBA

Ok, the title became too lengthy, but the idea is to try to duplicate the beauty of what this formula does:

And this is the cell of the formula above: Anyway, the strange thing was that we have beautiful

Python – Read and Write to Excel ActiveX Textbox

Reading and writing to an Excel ActiveX textbox with Python can be fun. If you really do not have anything better to do. Anyway, if this is your current task, you are on the correct place to see how it

Tagged with: , , , , ,

Python – How to fill Excel cell with image, using python

If you have ever dreamed that it will be possible to fill out an Excel cell with a picture, using Python, then you should probably reevaluate your dreams. Seriously, who dreams of something like that? Without further dreaming, the code

VBA – Printing Dictionary of a Dictionary of a Dictionary…

Working with dictionaries in VBA is a bit more unpleasant, than working with dictionaries with almost any other language. Because of the VBA IDE, you only see the keys, but not the values. Thus, if you have experience with Visual

Tagged with: , , ,

VBA – Automatically Save Excel File with VBA

Saving Excel files, when working with VBA is unfortunately a bit of pain the ass. You always need to make a new version every now and then, because it does not matter how seasoned VBA developer you are, still there

Tagged with: , , , , ,

VBA – Ubound of Multidimensional Array or How to Get What We Need?

Transforming Range to Array in VBA is actually a one liner – we take the range and we assign it to a variant:

The “strange” part is that the array is converted to 2-dimensional array after this: and working

Tagged with: , , , , , ,

VBA and Python – Intersection of dictionaries

Intersection of dictionary (or of any two lists) is a list with elements, that are present in both other lists. Thus, if we have the following 3 dictionaries in Python:

Then, an intersection of their keys will contain only

Tagged with: , , , , , ,

VBA – Make Excel Comments Beautiful

Everyone, who has worked with Excel more than a year knows that the comments are actually quite useful – they allow us to put info data into a cell, without actually putting data in the cell. However, the standard way

Tagged with: , , , ,

VBA – IIF() vs IF()

What is the difference between IIF() and IF() in #VBA? The idea of IIF() is that it evaluates both the True and the False part of the condition, before evaluating the condition itself. Thus, if the False part throws an

Tagged with: , , , ,

VBA – Hashing in Excel with HMACSHA1

Hashing strings in general is useful. It is one of the good things, that we get from granted by the various .Net libraries and we should not try to do on our own, as the HMACSHA1 is quite a powerful

Tagged with: , , , ,

VBA – Convert Excel Column Number to Letter and Letter to Column Number

Converting Excel column number to letter and letter to column number is actually something that every VBA developer does at least once a day. The easiest way is probably to use the property .Column or .Address of the range object that

Tagged with: , , , ,

Excel – Index(Match) based on multiple columns

Everyone knows the feeling that they need to use the =Index(Match(),Match()) formula in Excel and something tiny was not enough to reach their goal. Some time ago I knew that something is missing I was trying to “filter” with the

Tagged with: , , ,

How to fix – This workbook contains one or more links that cannot be updated…

Ok, if you are visiting this article, then probably the reason is that you have received the following messagebox upon openning of Excel: And after looking all over your cells, with both VBA and “Find”, you have not found anything

Tagged with: , , , ,

VBA – Nested Dictionary

Nested dictionary means a dictionary within a dictionary. Some days ago last week I was trying to build one and it took me some solid 15 minutes to do it, thus I have decided that it is worth an article

Tagged with: , , ,
Top