Hi All ,
Suppose i have selected a cell and i copy data from it to another Cell , then i want to go back for the original Cell.
how to do that ?
Hi All ,
Suppose i have selected a cell and i copy data from it to another Cell , then i want to go back for the original Cell.
how to do that ?
You only get events triggered when you ENTER a cell, not when you exit it, so you would need to keep a history of the cell you were in before the one you were in now.
Something like this in the 'Sheet' area of the code:
![]()
Dim cell_position(0 To 1) As String
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) cell_position(1) = cell_position(0) cell_position(0) = Target.Address End Sub
![]()
Sub Go_Back() If cell_position(1) <> "" Then Range(cell_position(1)).Select Else MsgBox "No previous cell stored" End If End Sub
If you find the response helpful please click the scales in the blue bar above and rate it
If you don't like the response, don't bother with the scales, they are not for you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks