I have been having some trouble using Application.ThisCell and need some help. To explain the issue, I created some simple code.
There are two workbooks. In each one, I have the following UDF in a module.
Function CalcIt(ByVal x As Variant)
CalcIt = Application.ThisCell.Column & Cells(Application.ThisCell.Row, 1)
End Function
In Workbook1, cell A1 = "Apple" and B1 = CalcIt(A1)
In Workbook2, cell A1 = "Orange" and B1 = CalcIt(A1)
Each workbook works correctly by showing "2Apple" in Workbook1 and "2Orange" in Workbook2 in cell B1, except when I do a CalculateFullRebuild (SHIFT+CTRL+ALT+F9). If I do it in Workbook1, the incorrect value is shown in Workbook2 (and vice versa). Can someone please explain why this happens?
Also, why can't I do a simple calculation (F9) or for the workbook (SHIFT+F9) to re-calculate?
Thanks for you help - Wellyn
There are two workbooks. In each one, I have the following UDF in a module.
Function CalcIt(ByVal x As Variant)
CalcIt = Application.ThisCell.Column & Cells(Application.ThisCell.Row, 1)
End Function
In Workbook1, cell A1 = "Apple" and B1 = CalcIt(A1)
In Workbook2, cell A1 = "Orange" and B1 = CalcIt(A1)
Each workbook works correctly by showing "2Apple" in Workbook1 and "2Orange" in Workbook2 in cell B1, except when I do a CalculateFullRebuild (SHIFT+CTRL+ALT+F9). If I do it in Workbook1, the incorrect value is shown in Workbook2 (and vice versa). Can someone please explain why this happens?
Also, why can't I do a simple calculation (F9) or for the workbook (SHIFT+F9) to re-calculate?
Thanks for you help - Wellyn