LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default use vba function in formula

Hi
try
Public Function myRange(chaine As String) As Range
set myRange = Sheets("Référence").Range(chaine)
End Function


--
Regards
Frank Kabel
Frankfurt, Germany

"Sylvain" schrieb im Newsbeitrag
...
Thank you for your quick reply but i need one more information,

please.

What should be the return type of my function to be useable as

argument for
other standard functions in formulas, such as Sum, Correlation

coefficient
calculus, ... ?

I have tried the following function, but it doesn't work :

Public Function myRange(chaine As String) As Range
plage = Sheets("Référence").Range(chaine)
End Function

If i write a formula such as
=SUM(myRange("B29:B31"))
It doesn't work.

Thank you for your help !

Sylvain Caillet



"Frank Kabel" a écrit dans le message de

news:
...
Hi
if you don't declare the function as private and put it in a

standard
module you can simply use your function as you would use a

worksheet
function.
Also see
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"news.wanadoo.fr" schrieb im Newsbeitrag
...
Hi !

Is ther any way to use some vba function i wrote in my cells

formulas
??

for example : =myfunction(A1:A10)

with

function myfunction (myRange as range)
....
end Function

Thank you all for your answers

Sylvain Caillet








 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with function / Formula Jerry Bailey Excel Worksheet Functions 4 January 29th 09 05:09 AM
Help with OR function in IF function formula veggies27 Excel Worksheet Functions 3 March 18th 08 10:04 PM
Help with function/formula please!!! Ssuzs Excel Worksheet Functions 7 June 13th 07 08:31 AM
Function or formula Martin Excel Worksheet Functions 4 January 8th 07 05:01 PM
A formula/function to return a formula/function sith janitor Excel Worksheet Functions 4 September 22nd 06 05:01 PM


All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"