You have:Public uid As String, and
Public Sub getData(uid, dept As String)
These are two different uid variables. So,
uidrow = Application.WorksheetFunction.Match(uid, wBook.Worksheets("Directory").Range(Dir_MRange), 0)
should have a problem (ambiguous/conflicting names). Since you are using the public var: uid in the function code, you should change this one.
Also, in the parameter declarations Public Sub getData(uid, dept As String) As String only types "dept" as String, not "uid" . Each variable must be typed separately:
Public Sub getData(ByVal uid As String, ByVal dept As String)
Also, your function:Public Function Get_Dept(uid_local As String)
doesn't specify a return data type so it is Variant by default, it should be String:
Public Function Get_Dept(uid_local As String) As String
Bookmarks