I am kinda new to VBA, appreciate your help on the subject.
So, I would like to use a User Defined Functions (or better if can be done with Excel function), to achieve the following cross reference:
[Book1, Sheet1, Cell A1] formula is something like UDF([Book2, Sheet2, Cell B1]), and it returns the sheet name of the cross reference worksheet, in this case [Sheet2], while Book2 is closed.
(While in Book2, Sheet2, Cell B1, the formula will be something like UDF([Book1, Sheet1, CellA1], and it returns Sheet1.)
If Book2 is opened, I can just returns the cross reference sheet by using the [selected cell].Parent.Name, to Book1. But it returns #VALUE! if Book2 is closed.
So, I would like to use a User Defined Functions (or better if can be done with Excel function), to achieve the following cross reference:
[Book1, Sheet1, Cell A1] formula is something like UDF([Book2, Sheet2, Cell B1]), and it returns the sheet name of the cross reference worksheet, in this case [Sheet2], while Book2 is closed.
(While in Book2, Sheet2, Cell B1, the formula will be something like UDF([Book1, Sheet1, CellA1], and it returns Sheet1.)
If Book2 is opened, I can just returns the cross reference sheet by using the [selected cell].Parent.Name, to Book1. But it returns #VALUE! if Book2 is closed.