What do you mean by "custom function?" A function procedure intended to be called from a worksheet cell (aka UDF)? If so, then this is the kind of operation a UDF is not allowed to do. You'll either have to stick with a Sub procedure or devise a completely different approach.
Bookmarks