General Names and Links question

M

matts2

I am having a series of recurring problems, so I think I need to read
something and I hope someone can point me to a good resource.

I have made a macro that copies various "template" sheets from one
workbook to another. I have a bunch of "presentation" sheets that are
nicely formatted and "data" sheets that have all of the calculations.
The "presentation" sheets refer to cells and names in the data sheets.
And the data sheets refer to a named range that exists in the new
workbook.

All of the copying works just fine, but I am having problems with
both links and names. Sometimes, but I can't figure out when, the
copied presentation sheet refers not to the copied data sheet, but to
the old data sheet in the presentation workbook. And sometimes, but I
don't see the pattern, the data sheets do not refer to the named range
in the new workbook, but refer to some (non-existent) named range on
the sheet itself. When I hand delete that name, the sheet works, but
when I programmatically delete it the whole process gets messed up.

I am asking for a solution to this problem (which is probably not well
enough described, but I did the best I can), what I would like is
something that gives me a solid understanding of how Excel handles
these things, when links and names update, when they don't, how it
works, etc.

TIA
 
G

Guest

Use the debug options in the visual basic editor to step through the code and
add break points. Use the mouse (or watch windows) to isolate the problems.
 
M

matts2

Use the debug options in the visual basic editor to step through the code and
add break points. Use the mouse (or watch windows) to isolate the problems.

Thanks, but that doesn't help in this case. I am trying to understand
how names and links work during copying. Sometimes they seem to go
with the destination, but sometimes not. And, yes, I do know that I am
asked what I want to do, but the results don't make sense to me. I am
sure that there is some factor I am missing here.

I can "fix" an instance by deleting a "local" name, but that does not
help all that much for an automated system. I want to have it right in
the first place, not clean it up individually later.
 

Ask a Question

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.

Ask a Question

Top