Need a book? Engineering books recommendations...

Return to index: [Subject] [Thread] [Date] [Author]

RE: VBA Question

[Subject Prev][Subject Next][Thread Prev][Thread Next]
If you want to pass the address (row, column, or both) to a function,
use the "CELL" spreadsheet function in the macro function call.

Say you have a macro function called rajendran which we want to return
the active row number multiplied by 2.  

Here is the function call that would be placed in the spreadsheet:

=rajendran(CELL("row"))

Here is how the function in the module might look:

Function Rajendran(x)
Rajendran = x*2
End Function

Hope this helps,
Chris


-----Original Message-----
From: P.Rajendran [mailto:rajendra(--nospam--at)mmind.net]
Sent: Saturday, November 07, 1998 4:13 AM
To: seaint(--nospam--at)seaint.org
Subject: Re: VBA Question


I have a programming question. I am attempting to write a user defined
function in Microsoft Excel.  In that procedure, I want to find the row
number of a cell, that has been highlighted (either by a mouse click or
by the movement of the up, down, side arrows), in a worksheet.  What are
the appropriate VBA statements?
 
Thanks.
 
Rajendran