I need to get the name of the worksheet in which the user is currently editing cells. Activesheet.Name normally works, but if the user changes sheets while editing a cell I get problems.
Assume that the code below is running for 'Sheet1':
Private Sub Worksheet_Change(ByVal Target As Range) debug.print = ActiveSheet.Name End Sub
It triggers whenever a cell in that sheet changes. However, it is also possible that the user on 'Sheet1' starts to edit a cell and then (while still editing) clicks on 'Sheet2', thereby activating it. The code above will then print 'Sheet2'. Strictly speaking this may be correct since 'Sheet2' was activated. However, I still need to know what sheet the user was changing a cell in - and that was 'Sheet1', not 'Sheet2'! Anyone know how to do this? cheers, Mikael