Follow our Network


Excel Tips: How To Create a Dynamic Range of Cell Selection

(3)

Category : excel, how to

In the past couple of months of working on Excel and VBA Macros, I have been exposed to a few challenges which in the course of time, I have overcome. So, I thought I would share them with my beloved readers. This section: Excel Tips aims at sharing the small tips and tricks that I have come across which makes life easier for anyone working with Excel or VBA Macros. Cheers!

Here we’ll be focussing on how to select a range dynamically and perform further operations to it etc.
For e.g. If we have a Sheet “Input” of which one cell is required say column B, and we need to perform some kind of mathematical operation on them – viz. average, sum, etc. we need to do that by selecting the entire range of non-empty values of those two cells.

The problem here is that the number of entries in column A will vary from time to time, but we want a command button which automatically knows the amount of non-empty values and accordingly runs the mathematical operation. This is known as Dynamic Range Selection.