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:


Here is how the function in the module might look:

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

Hope this helps,

-----Original Message-----
From: P.Rajendran [mailto:rajendra(--nospam--at)]
Sent: Saturday, November 07, 1998 4:13 AM
To: seaint(--nospam--at)
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?