I understand your code but not your problem/question.
Originally Posted by
hopefulhart
the problem is i change the text often and insert and delete rows constantly, and when i insert a new row into the field i get the message "run-time error '13': type mismatch"
Do you mean you insert and delete rows in your worksheet, or you insert and delete lines of code? What does "insert a new row into the field" mean? What's "the field"?
What line of code is indicated when you get that runtime error?
If Target is blank, then your code will do nothing just the way it is. So I am not sure what you are getting at.
Regardless, I would write the code like this (compiled and tested). I am taking advantage of the fact that the file name you are linking to is the same as the string in the target cell. If that assumption is not always true then this won't always work.
Bookmarks