Mart van Hulten
New Member
- Joined
- Oct 9, 2018
- Messages
- 11
I have this function:
Function student()
student = Range("'" + Range("B1").Value + "student'!" + Application.ThisCell.Address).Value
End Function
I use this function in worksheet1.
The value in B1 gives the name of another worksheet, let's say ws2. I need to pick up the value in that other worksheet, in the cell with the same address as the cell in worksheet1 that uses this function.
So, for instance in worksheet1 in A4 I write: =student()
But, as soon as I have clicked in another sheet, I get an error and, whatever I do, the error remains. Untill I dubbleclick + ENTER on the cell in worksheet1.
What am I doing wrong?
Function student()
student = Range("'" + Range("B1").Value + "student'!" + Application.ThisCell.Address).Value
End Function
I use this function in worksheet1.
The value in B1 gives the name of another worksheet, let's say ws2. I need to pick up the value in that other worksheet, in the cell with the same address as the cell in worksheet1 that uses this function.
So, for instance in worksheet1 in A4 I write: =student()
But, as soon as I have clicked in another sheet, I get an error and, whatever I do, the error remains. Untill I dubbleclick + ENTER on the cell in worksheet1.
What am I doing wrong?