go back/previous cell
Thank You, Thank You, Thank you.
"Bernie Deitrick" wrote:
jasminesy,
Put this into a regular codemodule:
Option Explicit
Public OldCell As Range
Public NewCell As Range
Sub GoBack()
OldCell.Select
End Sub
Put this into the worksheet's codemodule (copy the code, right click on the sheet tab, select "View
Code" and paste into the window that appears:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = NewCell
Set NewCell = Target
End If
End Sub
Then when you want to go back to the previous selection run the macro "GoBack"
HTH,
Bernie
MS Excel MVP
"jasminesy" wrote in message
...
is there any way to go back to a previous cell? Say am in a1 and hit enter
(or tab), is there any way programmibly to get back to the cell (or at least
get it's address) automatically with out knowing the cells name or position.
|