Select Page

## Named ranges are super cool.

Wouldn’t it be even better if we wouldn’t have to keep re-adjusting them? Imagine if they would expand and contract according to what is inside of them?

Guess what.

It is possible, with a couple of clever formulas.

Here I have to credit to an unknown author.
I didn’t come up with this option. I am nowhere near as clever.
Nobody knows who invented this technique in excel, but perhaps it is not the most important thing here.
The most important thing is to spread this technique to as wide of an audience as I can.

If you are here I presume that you understand the basics of Named ranges.
So I will not bore you with this.

For the coming exercise we will add the formulas for the named ranges in the Name Manager under the Formulas tab.

#### Expanding and contracting named ranges

All of the examples presume that the cells you trying to add to a dynamic range are in Column B.

For only numeric values in the cells use:

`=OFFSET(\$B\$1,0,0,COUNT(\$B:\$B),1)`

For mixed (numeric and text) values in the cells use:

`=OFFSET(\$B\$1,0,0,COUNTA(\$B:\$B),1)`

#### Numeric and Text

Hope that you can use this technique in your day to day work.

If you like this article and want to learn excel with us, you can follow us on our facebook page. Our blog is also exists in hungarian.

## Delete named ranges with VBA code

Thomas Szigeti Another one of those issues that you come across when you are busy, and have to do things on the fly. When your manager sends you a file to adjust something. Then you open the file, and start to get the feeling that "something is not right here"...And...

## How to add an Excel VBA code to my workbook?

In this post I will explain how to add any code to yook to run macros.

## Export Range to jpg with Excel VBA

A code to be able to save a range from your workbook as a .jpg picture.

Call the windows open file dialog from excel VBA. Allow your users to pick the file your macro need.

## Excel VBA Clear the clipboard

How to clear the clipboard in VBA. Come and grab the code from us.

## Delete Rows with VBA

Delete rows with VBA?
There is a trick to it! Come and grab the ready made code from us.

## Remove Accents in text with a custom VBA function

Remove accents in excel with this VBA code.

## Convert Conditional formatting

Sometimes it is required to convert conditional formatting in to cell formatting. We have written the code for you. You can copy and paste the ready made code to your project.

## Square root VBA

This post will show you how to find the square root in Excel VBA.

## Automatically add button to worksheet in VBA with a macro assigned to it.

This post will be for a solution that I had to develop to a database where I had to give the option to my end users to be able to delete a row with no hassle. Here I create a button, and if you press that button you can run a piece of code.