View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dpb dpb is offline
external usenet poster
 
Posts: 109
Default Enter value in compute cell location?

On 1/22/2018 8:39 AM, dpb wrote:
On 1/16/2018 7:06 PM, Jianguo Li wrote:

....

DANG! Need to fix a couple typos...

OK, here's the working implementation --

....


Sub SetValue(RefCell As Range, offSrce As Long, offTarg As Long)
' Set cell at OFFSET(REFCELL(0,offTARG) with value from
'Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* OFFSET(REFCELL(0,offSRCE)
' Uses SUB to do dirty work since UDF can't directly alter itself


Just saw hadn't made intended edit to above comment -- should read as or
equivalent to

' Uses SUB via .Evaluate to do dirty work since UDF can't directly alter
' cell location other than itself

....

And, just for funs, another function found that allows you to add
IntelliSense help for UDFs...

Sub DescribeFunction()
Â*Â* Dim FuncName As String
Â*Â* Dim FuncDesc As String
Â*Â* Dim Category As String
Â*Â* Dim ArgDesc(1 To 3) As String

....

For the specific example, there are four arguments so

Dim ArgDesc(1 To 4) As String

--