I have a workbook with several modules in it some which run the same sections of code. I think I could probably create a function so that the code is only written once and then refer to that function on each sheet but what would really be useful would be if I could run the section of code once via workbook open and then store the result as MyValue which could then be used across any module. I have done lots of searches but cant find how to do it. I must confess I dont understand a lot of the results I have looked at so anyhelp with code or an explanation would be much appreciated