If you are declaring this as a function, it must return a value. The code snippet you have provided should be called a Sub vice a function because it does not return a value.