LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default return the current row number for use in a formula

How do I return the row number of the current (not necessarily active) cell
for use in a custom formula? =Row() in a cell returns that cell's row number,
but I can't figure out how to use that in a custom formula. For example, code
such as this doesn't work because Excel gives me a compile error on "=Row()".

Public Function myFunction()
Dim Variable As Integer, Result As Integer
Variable = Row()
Result = Variable + 10
myFunction = Result
End Function

Thanks very much.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to determine number of current records by week Keith Excel Worksheet Functions 6 February 6th 07 04:33 PM
How do you return current ROW number to definition in NAME function? Franz Verga Setting up and Configuration of Excel 1 July 24th 06 04:13 PM
How do I convert a formula calculated number to a current value ? Chandler New Users to Excel 2 January 2nd 06 12:44 AM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM
Return number of current sheet Brandon Excel Worksheet Functions 3 April 26th 05 05:55 AM


All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"