# Off Topic > Tips and Tutorials >  >  Macro for Dynamic Ranges

## shg

I end up making dynamic ranges in most workbooks, and tire of typing then in. The code below allows you to select a range and it makes dynamic ranges using the header row, for numbers or text, according to the contents of the cell below the header.




```
Please Login or Register  to view this content.
```


Here 'tis, hope you find it useful.



```
Please Login or Register  to view this content.
```

----------


## tone640

Love this, it's a huge help.  I can't figure out how to make the scope of the ranges cover the whole workbook - they are also greyed out when I try and edit them - is it possible?

----------


## shg

I added a prompt to let the user select workbook or worksheet scope.

----------


## acsishere

Dear Sir,

I am in need of such a macro.  But the file extension is .bas

How to apply in a common file and make use of the codes.  Please guide us with a sample excel file.

Please...

----------


## shg

Put the bas file in a directory, open the VBE, and drag the file into the VBA project.

----------


## acsishere

Dear Sir,

Thank you for your guidance.

----------


## billj

This macro is very cool. Well respected  :Smilie:

----------

