By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


Get Address of a Range name

Search on google I come across ExcelJet.net, which has a complex article on how to create the function with no VBA.

https://exceljet.net/formula/get-address-of-named-range


=ADDRESS(ROW(nr),COLUMN(nr))&":"&ADDRESS(ROW(nr)+ROWS(nr)-1,COLUMN(nr)+COLUMNS(nr)-1)


Now, this code will make the spreadsheet much more complex. A better solution is the following VBA routine


Function Addr(rn)
' rn is a range name in as a string

Addr = Replace(Range(rn).Address,"$","")
End Function


I want to use this function when a cell is dependant on another cell. This allows me to give a message that tells the user what to fill in.