Sure. Use the macro recorder to get the code. Tools, Macro, Record Macro.
Be prepared to do modifcation to the result.to make it useful. For example,
Excel records the range of data that you have. If you later expand the
data, then the code is not right.
Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857 http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
If you mean define the range for a pivot table source, it would be easier to
use a Defined name as a source and have the defined name built with formulas
that establish the breadth and width of the source data.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.