Hello, I am sorry for my bad English. I am a student from Germany and I have the following problem: I am doing a Master which is in fact a combination of Humanities and Computer science. I did a Java course but last week we have received several exercises about VBA Excel, without having a lecture or training before. The reason for this mess is that we have to visit another faculty and the staff administration has a lot of problems to coordinate things. But anyway: I would be extremely thankful, if you could help with the following exercise:
"Write a function, that calculates the distance between two points from a list of coordinates. The function receives the start and end point as arguments. The program should search for the given points in the list (which is in my excel sheet) in order to calculate the distance between them.
Tip: The numbers of Points could be Strings as well. The function CStr(number) transforms a value into a String."
I wrote the following function for the distance and it works
Function distance(ya As Double, xa As Double, yb As Double, xB As Double)
distancePoint = Sqr((ya - yb) ^ 2 + (xa - xB) ^ 2)
End Function
Sorry for my lack of knowledge, but as I said I have started to work with VBA-Excel just one week ago.
It would be great if you could help me.
Thanks
"Write a function, that calculates the distance between two points from a list of coordinates. The function receives the start and end point as arguments. The program should search for the given points in the list (which is in my excel sheet) in order to calculate the distance between them.
Tip: The numbers of Points could be Strings as well. The function CStr(number) transforms a value into a String."
I wrote the following function for the distance and it works
Function distance(ya As Double, xa As Double, yb As Double, xB As Double)
distancePoint = Sqr((ya - yb) ^ 2 + (xa - xB) ^ 2)
End Function
Sorry for my lack of knowledge, but as I said I have started to work with VBA-Excel just one week ago.
It would be great if you could help me.
Thanks