Author: Vitosh
A VBA Developer.

VBA – Cells and Ranges in Excel (A bit more than the standard story)

Excel’s ranges and cells are both complicated and very simple. They are simple, because everyone has an idea what is a range and what is a cell, and they are complicated, because these are both: Properties of the worksheet object

Tagged with: , , ,

VBA – Benford Analysis (First-Digit Law)

Long time ago, an astronomer called Benford was taking a look at logarithm books, noticing that the earlier pages (starting with 1) are pretty much more worn out than the later ones. He thought about the result, and managed to

Tagged with: , ,

VBA – Dictionary

VBA has a dictionary structure. Dictionary is an object, and it can be referenced either with early binding or with a late binding, referring to Microsoft Scripting Runtime: What is a dictionary? This is the Microsoft definition of the VBA

Tagged with: , , , , ,

Python – Stand Alone Application with GUI

Python has a built-in GUI package, which allows easy building of forms like this: The package used in this example is tkinter. The form above takes the value, entered in the entry field, squares it and displays it back in

Tagged with: , , , ,

C# – CodeForces – From Hero to Zero

It was some time ago, since I last took a look at programming challange in CodeForces, thus I have decided to take a look again. So, I chose the lowest problem of the second division just to boost up my

C# – Look at the Variables’ Values, while Debugging in Visual Studio

Debugging is like being the detective in a crime movie where you are also the murderer. In order to debug well, we need to know the value of the current variable. In Visual Studio, this could be acquired through multiple ways.

Tagged with: , , , ,

Top VBA-Excel errors

Some months ago #VBA was finally considered the most dreaded language in the 2019 StackOverflow survey: One of the reasons for this, is probably that #VBA is quite too easy to enter, thus plenty of non-IT professionals feel fascinated about

Tagged with: , , , ,

VBA – Abstract classes. Classes, that cannot be instantiated.

There are parts of #VBA, that can scare any VBA developer, who has not bumped into other languages. Although, the “abstract class” term is quite popular in C# and other languages, and is quite easy to be created, in VBA,

C# – Reading from Excel Spreadsheets with Asynchronous Programming (Async)

Reading from Excel in C# is actally not at tough as many VBA developers would assume. The simple reading is actually quite straightforward – there is only small little trick, requiring the adding of the Microsoft.Office.Interop.Excel reference to the Visual

Tagged with: , , ,

C# – How to get the last filled cell of a given row in Excel

Getting the last row of a given column in Excel with a formula or with VBA is quite a trivial task. It is explained here quite well 🙂 However, when we come to C#, the only “trick” that is provided

Tagged with: , , , ,

C# – Find the Biggest Square in a Matrix – What can Excel and VBA add to it?

Finding the biggest square of specific units in a given matrix of these units is a standard dynamic programming problem. The examples in Google for it are above 18 million, thus I would simply show how it is done with

Tagged with: , ,

C# – Refactoring a Problem

Some days ago I have decided to take a look at one of the homeworks problem of the OOP course at SoftUni. Then, I have decided to solve it with my VBA OOP knowledge, implementing it in C#. Whether VBA

Tagged with: , ,

C# – Quick Reference for Abstract Classes

Abstract Classes in C# are classes, intended only to be a base class of other classes. Members marked as abstract, or included in an abstract class, must be implemented by classes that derive from the abstract class. Reference With other

Tagged with: , ,

Visual Studio – How to create a custom shortcut

If you want to create a custom shortcut to a command in Visual Studio, these are the steps to be taken: Ribbon>Tools>Options Environment>Keyboard Show commands containing (write the command) Press shortcut keys Assign and OK

Tagged with: , ,

VBA – How to copy a new object in VBA, without copying its reference

Copying an object in VBA to a new object is somehow tough. If you use  Set foo = bar then, both foo and bar would be pointing to the same address in the heap. And if you change the properties of one, you would automatically

Tagged with: , ,

C# – Entity Framework – Using LINQPad for Queries – Just Getting Started

After the previous two articles for C# – Foreign Keys in Entity Framework – Code First – Query with Linq and Entity Framework – Linq vs Extension Methods (Example) it is a good idea to present some actions with LINQPad. LINQPad5 is

Tagged with: , ,

C# – Foreign Keys in Entity Framework – Code First – Query with Linq

In this article, I present an Entity Framework example, building two tables with foreign keys, using code first. The sample I am using is building over the previous article for EF. Pretty much, when you are running your application, if

Tagged with: , , ,

Entity Framework – Linq vs Extension Methods (Example)

This article presents a simple example of querying with Linq and Extension Methods in Entity Framework (EF). To set the EF, create a C# Console application. Then add the Package Manager Console from Tools: Then run Install-Package EntityFramework in the Package

Tagged with: , , ,

VBA – Environmental Variables

The environmental variables are a dynamic-named values that can affect the way running processes will behave on a computer. With other words, if you want to see them in your PC, simply open the command prompt and write the nice word

Tagged with: ,

VBA – Data scraping from Internet with Excel – Part 2

Some time ago I wrote an article for Data scraping from Internet with Excel , which was scraping book information from amazon.com, based on a given word. Thus, for a keyword as “VBA”, this is the data, printed in the immediate

Tagged with: , , ,

VBA – Add Shape to Range in Excel

Adding shapes to a range in VBA with Excel is actually a trivial task, if you are aware of the Shapes.AddShape method. It has 5 parameters, 4 of which could be pretty easily remapped to the parameters of the range:

Tagged with: , ,

VBA – Animation with Excel

Animation consists of some pictures. In general, there are about 24 pictures per second, in order to do the “magic”. This could be easily automated with Excel, using  Application.Wait (Now + #12:00:01 AM#), if we agree to make it a bit old-fashioned, with 1 picture

Tagged with: , ,

VBA – Extracting text from string between two identical characters using VBA

Automation of Excel is actually pretty interesting task. VBA is indeed the best built-in tool for this and although there is a lot of “hate” towards it it really deserves to be taken into account seriously, at least for small daily

Tagged with: , , ,

VBA – RegEx Used to Take the Valuable Data Out

Writing for RegEx in VBA is sometimes a good idea and sometimes a bad idea. Anyway, if you need to write one, you better be careful. These are the RegEx articles in VBA in VitoshAcademy so far: https://www.vitoshacademy.com/vba-regex-in-excel-part-2/ https://www.vitoshacademy.com/vba-regex-in-excel/ So,

Tagged with: , ,

VBA – AutoMacro AddIn – VBA Software Review

VBA is extremely underestimated programming language. I have always been thinking that there are almost no real #VBA developers, because the “real” developers do not want to do some meaningless “macro” stuff and the people who work with #VBA are

Tagged with: , , ,

VBA – How to check messages for specific words before sending them with Outlook

Gmail has the option to revert a message for about 10 seconds after you have sent it: Well, Outlook with VBA can do similar things, if you are willing to program it a bit with VBA. Let’s say that you

Tagged with: , , ,

Last Used Row (Last Used Column) in Excel with Formula (without VBA)

Getting the last row of a given column in Excel is easily done with a User-Defined Function in VBA:

There are two other formulas, which would get the last used cell in a given row, depending on whether it

Tagged with: , , ,

C# – Split String in One Line and Get the First SubString

Imagine, that you are given a string in C# with some separator in it, and you need to split it and refer to the first or the second part of the splitted string. E.g., you are having  *AAAaa*SEPARATOR*zzZZZ* and with one line,

Tagged with: ,

VBA – How to handle only specific errors in VBA

Sometimes, but only sometimes, someone needs to handle specific VBA errors and to avoid them. Or to ignore them. Or anything like this. Let’s say, you want to avoid error number 91, because you think that it is a case

Tagged with: , ,

Add comments in Excel with VBA

Adding comments with VBA is somehow quite a trivial task, if you already have the text of the comment and you are allowed to delete the comment if it is present. In general, the only difficult part is the check,

Tagged with: , , ,
Top