ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   'ActiveWorkbook.Names.Add Name:' how to make range variable? (https://www.excelbanter.com/excel-programming/331331-activeworkbook-names-add-name-how-make-range-variable.html)

TeeSea

'ActiveWorkbook.Names.Add Name:' how to make range variable?
 
Data is coming into a worksheet, and from a macro, I determine the range
using Selection.CurrentRegion.Select, I then .Add Name, but the macro is
setting the range. I want the range to change each time the macro is run.

Tom Ogilvy

'ActiveWorkbook.Names.Add Name:' how to make range variable?
 
Hard to say what the problem is without seeing your code.

Perhaps

Range("A1").CurrentRegion.Name = "Data1"

--
Regards,
Tom Ogilvy


"TeeSea" wrote in message
...
Data is coming into a worksheet, and from a macro, I determine the range
using Selection.CurrentRegion.Select, I then .Add Name, but the macro is
setting the range. I want the range to change each time the macro is run.





All times are GMT +1. The time now is 02:44 AM.

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