LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to write a formula with a user defined function


Tried to write something like this:
[image: http://img461.imageshack.us/img461/7426/excel2co.jpg]

Here s the code:

Sub WriteFunctionTerm(TargetAdress, Order, xValueAdress, yValueAdress)
Dim OrderStr$

xValue = Range(xValueAdress).Cells
yValue = Range(yValueAdress).Cells
If Order = 0 Then
Range(TargetAdress).Cells = "f(" & xValue & ")=" & yValue
Else
OrderStr$ = String(Order, "I")
Range(TargetAdress).Cells = _
"f(" & OrderStr$ & ")(" & xValue & ")=" & yValue
Range(TargetAdress).Characters _
(Start:=2, Length:=2 + Len(OrderStr$)).Font.Superscript =
True
End If
End Sub

This works fine in a sub under a command button, but how to code it in
a function? The content of the cell will only refresh when I leave the
function....and how can I get the information from where the function
is called?
Thanx for helping!


--
reteid2222
------------------------------------------------------------------------
reteid2222's Profile: http://www.excelforum.com/member.php...o&userid=30745
View this thread: http://www.excelforum.com/showthread...hreadid=504114

 
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
how do i write and implement "pop-up" help for a user defined func Velvetlady Excel Programming 1 August 2nd 05 06:46 PM
Formula as User Defined Function EstherJ Excel Programming 3 October 8th 04 01:09 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
Is it possible write a self-defined function in excel that connect to SQL server to get data? tc Excel Programming 1 November 12th 03 05:52 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 01:39 PM.

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"