Hi!
I have a Function GETROLE
The usage of Function is : =GETROLE(A2)
It takes the string from the cell A2, searching the same value in other sheet and return some sting
The problem is: that I dont know how to get value(string) from CellRow, because I dont know what kind of object is sending in function. Any ideas?
Function GETROLE (CellRow As String) As String
Dim Doc As Object
Dim Sht, Cell_role, Cell_is_on, Cell_FIO, InPutFIO As Object
Dim FIO, rol as String
Doc = ThisComponent
Sht = Doc.Sheets.getByName("Роли")
MsgBox CellRow
For i = 1 to 100
Cell_FIO = Sht.getCellByPosition(i , 0)
If FIO = Cell_FIO.String Then
For j =2 to 60
Cell_is_on = Sht.getCellByPosition(i, j)
If Cell_is_on.String = "ДА" Then
rol = rol + Sht.getCellByPosition(i, j).String +"; "
End If
Next j
End If
Next i
GETROLE = rol
End Function