title: how do i set a value to a range using a function from module in excel vba?
body: <p>i want to do a simple function in a module in excel vba,
  so i can use it as a custom function in excel.
  (i use excel 2003, or 2007 , it's doesnt matter)</p>
  
  <p>i create a function(!) in a new workbook and it's looks like this:</p>
  
  <pre><code>Function a()
      Sheets(1).Range("A1").Value = 4
  end function
  </code></pre>
  
  <p>but when i try to use it on the sheet1 it's wont work!
  i tried many things.</p>
  
  <p>how can i make this work (with no workarounds, i want to use it as a custom function) ?</p>
  
  <p>please help.
  thanks,
  gadym</p>