![]() |
How do I edit a Named Range using macro's
Defining a Named Range assigns a name to the range. The range can be
manually changed based on a selection. However, when you try to record the steps up update the range of an existing Name, the range is hardcoded in the macro. Running the macro does not update the Named range. I am using the Named ranges in other macro's, e.g., selecting and copying data in the range, creating a pivot table based on the range. |
Selection.Name = "ABCD"
would update the refersto property of the named range "ABCD". If ABCD did not exist, it would be created. -- Regards, Tom Ogilvy "behmer" wrote in message ... Defining a Named Range assigns a name to the range. The range can be manually changed based on a selection. However, when you try to record the steps up update the range of an existing Name, the range is hardcoded in the macro. Running the macro does not update the Named range. I am using the Named ranges in other macro's, e.g., selecting and copying data in the range, creating a pivot table based on the range. |
Thanks a million. I spent nearly 20 hours trying complicated fixes, none of
them worked. This was a simple fix. "Tom Ogilvy" wrote: Selection.Name = "ABCD" would update the refersto property of the named range "ABCD". If ABCD did not exist, it would be created. -- Regards, Tom Ogilvy "behmer" wrote in message ... Defining a Named Range assigns a name to the range. The range can be manually changed based on a selection. However, when you try to record the steps up update the range of an existing Name, the range is hardcoded in the macro. Running the macro does not update the Named range. I am using the Named ranges in other macro's, e.g., selecting and copying data in the range, creating a pivot table based on the range. |
All times are GMT +1. The time now is 07:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com