We are not clear about your requirement. Please provide some further details about what your custom function will do and how you want to utilize the parameters in the custom function.
Sorry for not being very clear. I just want to know how to get/set a value from a named range without going through alot of extra steps. In Excel it is reletively easy, single range cell:
Dim MyString as String = xlApp.Range(MyRange).Value
or
xlApp.Range(MyRange).Value = 34
How can i get the value from a range somewhere in the workbook. You shouldn't have to know what sheet it is on. You don't have to in Excel.
Well, I think you may try the Worksheets.GetNamedRanges() method to get the named ranges and manipulate them as per your requirement. Please see the following sample code in this regard:
Dim wb As New Workbook()
Dim ranges() As Range = wb.Worksheets.GetNamedRanges()
Dim range As Range = ranges(0)
Dim value As String = range(0, 0).StringValue
For further details, please see the following document link: