ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Define name in macro (https://www.excelbanter.com/excel-programming/293357-define-name-macro.html)

Walleye Hunter

Define name in macro
 
I need to define a named range in a macro. The define name is not the
problem though. The sheet I'm using gets updated daily and varies as to the
number of rows. I need the macro to find the last record in the table and
reset the named range to include all data. I've tried and nothing I do seems
to work. Any suggestions would be helpful.

Thanks



JE McGimpsey

Define name in macro
 
Instead of using a macro, use a dynamic range that you can define once
and it self-corrects for additions and deletions:

http://cpearson.com/excel/excelF.htm#DynamicRanges

In article ,
"Walleye Hunter" wrote:

I need to define a named range in a macro. The define name is not the
problem though. The sheet I'm using gets updated daily and varies as to the
number of rows. I need the macro to find the last record in the table and
reset the named range to include all data. I've tried and nothing I do seems
to work. Any suggestions would be helpful.



All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com