Thread: VBA formula
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Suresh[_4_] Suresh[_4_] is offline
external usenet poster
 
Posts: 8
Default VBA formula

Hi all,


I wish to write a Excel formula (VB function) that would take a source
range, and a destination cell as parameters.
The function would do some calculations and would return the result. But
would also write some additional text to the destination cell.

I am not sure what I am doing wrong, could someone please help me ....

I have written a small function similar to the one that I actually need.



Function test(src As Variant, dest As Variant) as Variant
test = "100"
Range(dest).Formula = "=sum(" & Range(src).Address & ")"
End Function




Thanks.