Unless the sheet is newly inserted, the ActiveCell will become the last
ActiveCell at the time the sheet was de-activated.
In worksheet code (for Sheet1 for example) enter:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
WhereWasI = Target.Cells(1, 1).Address
End Sub
In a standard module, enter:
Public WhereWasI As String
Sub trace_it()
MsgBox (WhereWasI)
End Sub
Activate any cell on Sheet1, then activate any other worksheet, then run
trace_it.
It will report what will become the ActiveCell if Sheet1 is re-actvated.
--
Gary''s Student
"Jerry W. Lewis" wrote:
Without activating the sheet, how can I determine which cell on that sheet
that will become the ActiveCell once the sheet is activated?
I am trying to write a UDF that will be called from Excel (therefore
changing selections is not an option) that will return .Formula1 from the
conditional format of a cell whose reference is passed to the function. The
problem is that all relative addressing in .Formula1 is automatically
converted to A1 style relative to the cell that would be ActiveCell if the
cell's .parent were ActiveSheet. John Walkenbach's suggestion
http://j-walk.com/ss/excel/odd/odd07.htm
only works on ActiveSheet, but could easily be modified if I could identify
the equivalent of ActiveCell for a sheet that is not ActiveSheet.
Jerrry