Thread: VB Syntax
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default VB Syntax

try this =func1(b2)

function func1(x As Long)
application.volatile
func1 = x + 1
End Function


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dhstein" wrote in message
...
I'm trying to write a User Defined Function and need the VB syntax to
refer
to the cell. For example if my function is called func1 and I put the
formula =func1(B2) in my spreadsheet, I want to manipulate the contents of
B2
in my function.

What is the syntax to read/access the contents of cell B2 in my VB
function?


For example:

function func1(Entry As Long)
CellContents = ?????????????
func1 = CellContents + 1
End Function

Thanks.