ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding current row (https://www.excelbanter.com/excel-programming/358398-finding-current-row.html)

Bob Taylor

finding current row
 
I am writing a general function and I would like to know what row the
function was excuted from, so that I can place that value in
Cells(row,col).value I have not been to find a behavior that will do this.
can anyone help

thanks
Bob



Carim

finding current row
 
Hi Bob,

If I understand correctly
ActiveCell.Row
should do the job ...
Now if you need to store it, you would need to have a variable
Dim MyRow As Integer
and place following line in the right spot in your code
MyRow = ActiveCell.Row

HTH
Cheers
Carim


RB Smissaert

finding current row
 
Sub test()

MsgBox ActiveCell.Row

End Sub

RBS


"Bob Taylor" wrote in message
...
I am writing a general function and I would like to know what row the
function was excuted from, so that I can place that value in
Cells(row,col).value I have not been to find a behavior that will do this.
can anyone help

thanks
Bob



Ardus Petus

finding current row
 
Within an User Defined Function:
Application.Caller.row

HTH
--
AP

"Bob Taylor" a écrit dans le message de
...
I am writing a general function and I would like to know what row the
function was excuted from, so that I can place that value in
Cells(row,col).value I have not been to find a behavior that will do

this.
can anyone help

thanks
Bob





Tom Ogilvy

finding current row
 
Just note that in a User Defined function used in a worksheet (of which I
believe Ardus speaks), you can not write values to other cells.

--
Regards,
Tom Ogilvy


"Ardus Petus" wrote in message
...
Within an User Defined Function:
Application.Caller.row

HTH
--
AP

"Bob Taylor" a écrit dans le message de
...
I am writing a general function and I would like to know what row the
function was excuted from, so that I can place that value in
Cells(row,col).value I have not been to find a behavior that will do

this.
can anyone help

thanks
Bob








All times are GMT +1. The time now is 07:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com