NH Blog - Articles on VBA Excel

Dec 10, 2020

Difference between ByVal and ByRef in VBA

When you design a procedure in VBA you may want to pass some data values to it for processing. You pass data through arguments; like a and h below on lines 6 to 8; [...]

Jun 18, 2020

For Each loops in Excel VBA

Unlike the traditional For Next loops, the For Each loops do not iterate a ‘set’ number of times. Simply put, this looping structure allows you to iterate through a [...]

May 29, 2021

Recursive functions in VBA

In programming, you use functions for two purposes. You either want to reuse a piece of code over and over again, therefore you encapsulate it as a function, or you may [...]

Sep 30, 2020

Customise the Ribbon in an Excel workbook

We all know how to customise the Ribbon in Microsoft Excel by using the graphical user interface, but the problem with this way of customisation is that if you move the [...]

Aug 08, 2020

Easily delete blank rows from your data using Excel VBA

Quite often, you'll be required to remove non-contiguous blank rows to join ranges of data together. This is quite tricky to do in Excel, but I've explained how to do [...]

Jul 17, 2020

Remove blank rows in Excel with this VBA code

Quite often, you will find that you may have several table ranges in your Excel worksheet separated by blank rows that are undesirable. You also might even have a big [...]

Jun 30, 2020

How to populate tables in Excel VBA

There may be occasions where you need to populate an existing table with more data, and in such occasions, the first thing you would generally think would be "Where [...]

May 26, 2021

VBA Excel: Finding the last row of a worksheet (Part 2)

In my last blog post, VBA Excel: Finding the last row of a worksheet (Part 1), I explained how to use the control arrows to find the last row of a worksheet in VBA [...]

May 15, 2021

VBA Excel: Finding the last row of a worksheet (Part 1)

When creating macros in Microsoft Excel, you often want to find the last row of data in a worksheet to be able to choose the correct area so the macro can do things with [...]

top
Back to top