It sounds like texaslynn has already given you answers.
But I don't think I can help anyway, as you are failing to give enough information ... i.e. you say "but it wouldn't work for other workbooks" ... in what way wouldn't it work? Does the macro crash? If not, what actually happens? If it does crash, what is the message, and where does the macro break? What debugging have you tried to do?