This is a simple prototype of the function that I need because the problem arises with the Date object that takes the Weekday method as a parameter, as you can see, my function receives the values that you enter referenced by cells and in data type String. The drawback is that if I write for example "dd / mm / yyyy" does not recognize it, it should enter as "mm / dd / yyyy" but I need to see in the cells of my table in the first format. Can I use the string "dd / mm / yyyy" in some way and turn it into "mm / dd / yyyy" with some date method or something? Or if or should I resort to partitioning of strings and conversion to integers to create a date object with 3 numeric parameters?
Thank you in advance
Function cantObligaciones(docente As String, fecha As String, art As Integer)
If art = 80 Then
Dim datos As Range
Set datos = Worksheets(2).Range("h5:o10")
col = Application.WorksheetFunction.Weekday(fecha, vbMonday)
cantObligaciones = Application.WorksheetFunction.VLookup(docente, datos, col, 1)
End If
End Function
THANKS