Here is the code for the function I have used in my example:-
Public Function lastlistentry(myRange As Range)
myrows = myRange.Rows.Count
mystartrow = myRange.Row
mycol = myRange.Column
For i = mystartrow To myrows + mystartrow
' Debug.Print myRange.Rows
If Cells(i, mycol).Value <> 0 Then
lastlistentry = Cells(i, mycol).Value
GoTo 100
End If
Next i
100
End Function
But it is not the function I have the problem with. My add-in file is stored on an external hard drive. At home this is called the G: drive, at work it is called the F: drive. I'm not allowed to change the work drive letter and my home computer won't let me change that one to G: because all the lower letters are taken. When I run the add-ins on one computer, if I just enter the function name, all is fine. When I try it on the other computer, it adds a file path in front of the function name with the letter from the previous computer and says it can't find it. Even if I could get the external drive letter to be the same on these two computers, I want to have a general solution and be able to take my external hard drive to any computer and have the add-ins work without having to delete the incorrect file path from each cell in which the function is entered.
Any suggestions gratefully received.
Thanks & Regards
Neil Keron