In this article I will simply use the code from my first guest author Mathieu, to build up some small working solution, that uses parameters: So, the two classes, provided by Mathieu are here as well  GitHub, named AdoValueConventer.cls and SqlCommand.cls. …

VBA – Using Parameters in a VBA SQL Query To a Database Read more »

Mathieu Guindon is the project manager behind Rubberduck – an open-source COM add-in project written in C#, extending the glorious VBE with modern-day IDE features.  On Code Review and Stack Overflow he is closely monitoring the vba tag. Ex-moderator on Code Review  (2015-2018), Microsoft Excel MVP (2018). …

“OMG I CAN DO VB6 IN EXCEL! WATCH ME!!!” – Mathieu Guindon about VBA 15 years ago Read more »

Quick Search for value in Array. In VBA this is sometimes considered problem, as far as people tend to loop through the whole array for the search. There is a better way to do it, with System.Collections.ArrayList, which is not exactly …

VBA – How to Find TaxiCab Numbers in Excel – Quick Search in Array Read more »

Trimming is a function, that reduces spaces. There are at least 4 ways to Trim a string in Excel/VBA: Trim VBA.Trim =Trim() WorksheetFunction.Trim Thus, is there a difference between these 4 actually? This is what MSDN says about String.Trim: Returns …

VBA – Difference between Trim, VBA.Trim, =Trim() and WorksheetFunction.Trim Read more »

After writing that the built-in Find() function in VBA does not return the first value by default, a new interesting case with the Find function appeared. In order to simulate it, the following task could be imagined: Write the first …

VBA – Why Range.Find() sometimes mistakes January with November and Febrary with December? Read more »

Ok, you have read the title correctly – there is a way to refer a parameter ByValue, even though the parameter contains explicitly the word ByRef in it. Let’s start with the functions. Imagine a function, getting an array as parameter …

VBA – How to refer a function ByVal, when the parameter is explicitly ByRef Read more »

The Range.Find() function in VBA-Excel is quite a tricky one. In general, you may think it is straight forward, because it usually returns what you are looking for, until the moment when it simply surprises you. This is the MSDN description …

VBA – Find function in Excel does not return the first value by default Read more »