Hi
I have the below VBA Code being used in LibreOffice Calc. This code is working well when the code is placed into a module in the document.
I have moved this code to module in “My Macros & Dialogs” hoping to use this on every Cal Document as needed. However, the same code returns an error.
Is there a way I can get a reference to the NamedRange and with which I can use this Range Object for further processing?
Any help would is appreciated!
Option VBASupport 1
Option Explicit
Function GetReferenceName1(RefCell as Range)
Dim WB as Workbook
Dim WS as Worksheet
dim NamedRange as Range
dim sRefName as String
Set WS = RefCell.Worksheet
Set WB = Workbooks(ThisComponent.Title)
Set NamedRange = WB.Names("PersonNames").RefersToRange
GetReferenceName1 = NamedRange.Cells(RefCell.Row,1)
End Function