Question: Is there a way to declare/edit names using VBA?
Specifics (Unnecessary maybe? But they're here anyway if you need to understand better what I'm talking about):
I have two workbooks. One (we'll call "Main.xlsx") looks up information in the other (we'll call "Database.xlsx"). To do this, I created a name, "Database," (via the Name Manager, Ctrl+F3) that refers to the "Database" table within my "Database.xlsx" workbook. I use Main.xlsx as a template, and I create copies of this workbook and use them for different things and save them in different locations. However, all of these copies refer to my one "Database.xlsx" workbook.
There are two issues I'm trying to deal with.
First, when I save my "Main.xlsx" template and "Database.xlsx" in the same folder, the reference becomes a relative filepath instead of absolute (i.e. excel assumes that those two workbooks will always be in the same folder). To get around this, I just saved Main and Database in two separate folders, which is not ideal. If there's a way to edit the name references with VBA, I wouldn't have a problem fixing it.
Second, I plan on passing these workbooks onto other people. As it is now, my name references use absolute filepaths for my own computer. I would like to make it so they wouldn't have to manually edit the filepath using the Name Manager. Again, I could solve this problem if there were a way to edit those name references using VBA.
Thanks so much
Bookmarks