Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row Number of Current Cell - within a Function

Status
Not open for further replies.

VincentCrimmins

Programmer
Jan 16, 2008
37
IE
Hi,

I'm creating a Function that looks at the max value between two cells.

I can get the row number of the distant cell as I'm looking for a specific value.

However, I'm struggling to get the code to return the row number of the cell that the Function is currently being run on.

Any ideas?

Thanks
 
Could we have a look at the code you're using to give us an idea of how you're trying to do this?

Cheers

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Hi,

Code is:

Function HighToDate(StartLevel As Double)

Dim MaxPointRow As Integer
Dim CurrentRow As Integer

MaxPointRow = Excel.WorksheetFunction.Match(StartLevel, Range("H6:H4000"), 0)

HighToDate = Excel.WorksheetFunction.Max(Range("C" & CurrentRow & ":C" & MaxPointRow + 5))

End Function

*********

It's the CurrentRow I can't figure out how to calculate.

Thanks!
 
Yep - try the right forum: forum707

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top