Functions called from the worksheet cannot manipulate worksheet objects other than the active cell wherein the formula is entered.
This preserves dependencies in formulae, prevents circular reference errors, etc.
As a general rule, use Subroutines to manipulate objects, and use Formulae to return values (whether to a cell reference or to a variable).
One exception is that a UDF called from within a subroutine can manipulate worksheet objects, but this is probably not a good habit to start. Keep your functions limited to returning values to variables/cells, and use subroutines to manipulate objects.
Further reading:
Making Excel functions affect 'other' cells
http://www.ozgrid.com/Excel/free-training/ExcelVBA1/excelvba1lesson21.htm