Retrun row value for $A$12 , return 12

M

moonhk

Hi All

How to return $A$12 , 12 by Excel rows/address function ?

Current I am using below coding.

Function get_row(loString)
Dim a As String

get_row = Mid(loString, InStr(2, loString, "$") + 1, Len(loString) -
InStr(2, loString, "$"))


End Function

Sub test()
Dim a As String
a = "$A$12"
MsgBox get_row(a)
End Sub
 
R

Rick Rothstein

I would probably use this method myself...

Function get_row(loString)
get_row = Range(loString).Row
End Function

That way, the address being passed into the function can have any
combination of absolute and/or relative address components.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Find MatchCase problem 5
Calculating a worksheet 3
Array coding type mismatch 6
CheckIBAN 3
Type Mismatch 0
InputBox to name a range 2
Read the next line in a text file 12
Error: Argument Not Optional 0

Top