Into a module is the correct place, the ones marked sheet
are not dead they are for worksheet event macros and apply
only to the that sheet. You can read about Event macros
http://www.mvps.org/dmcritchie/excel/event.htm
and you can read more about macros installed into standard
modules like what you had, at
http://www.mvps.org/dmcritchie/excel/getstarted.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
wrote in message ups.com...
Bob Phillips wrote:
It sounds as though you have put the routine in the correct place.
I have found what the problem was:
When I went "Tools" / "Macro" / "Visual Basic Editor (Alt+F11)", I
found a blank window titled "Sheet1 (Code)". It seems to me that this
window is basically dead, at least the code for the UDF pasted here is
not picked up.
In order to make the UDF work, I now have to go InsertModule and paste
in the code in a new window, which looks very much like the other
"Sheet1 (Code)" window, except that its title is "Module1 (Code)".
Now it works like a charm!
Thanks a lot.