View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default wHAT AM i DOING wrong

You can't change cells from within a function; you can just replace the call
of the function by a result.

In none of the examples do you assign a value to the function; somewhere
there should be a

DisplayCellFunction = Someresult
or something similar

In example one you use F26 as a name, and/or it is not an integer
In example 2 you use text arguments, although they are declared Integers
Example 3 has no result assigned

--
Kind regards,

Niek Otten

"DMB" wrote in message
...


'Public Function C(cellID1 As String, cellID2 As String)
Public Function DisplayCellFunction(cellID1 As Integer, cellID2 As
Integer)
'Copy formulas to the adjacent cell for visual verification
'Range(cellID1) = "'" & Range(cellID2).Formula
Range("F26") = "'" & Range("d26").Formula
End Function


In the workbook I enter

=DisplayCellFunction(F26, D26)
I get a #Name Error

=DisplayCellFunction("F26", "D26")
I get a #Name Error

=DisplayCellFunction(6, 6)
I get a #Value! Error