Consulting

Results 1 to 3 of 3

Thread: After clicking the linked cell to move back linked cell without using F5+Enter

  1. #1
    VBAX Newbie
    Joined
    Apr 2020
    Posts
    2
    Location

    After clicking the linked cell to move back linked cell without using F5+Enter

    Hi guys i got a lot of linked excel sheets and books so i am continuously jumping sheet to sheet (cell2cell,book2book) and i wanna return back (after and after) the sheet or the cell without using F5+Enter funciton. Is it possible run a macro, i am looking for it for a long time, appreciate that

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Copy the TOC sheet in the attachment into your workbook. You might have to view a different sheet, then switch back to TOC to start it
    Attached Files Attached Files
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Apr 2020
    Posts
    2
    Location
    Quote Originally Posted by mikerickson View Post
    You could put this in the ThisWorkbook code module
    ' in ThisWorkbook code module
    
    Public PrevActiveCell As Range
    Dim CurActiveCell As Range
    
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
        Set PrevActiveCell = CurActiveCell
        Set CurActiveCell = ActiveCell
    End Sub
    and then call this (in a normal module) to return to the previous cell

    Sub GoBack()
        If Not ThisWorkbook.PrevActiveCell Is Nothing Then
            Application.Goto ThisWorkbook.PrevActiveCell
        End If
    End Sub
    This one looks like my solution but i couldn't run it. I may be not clear about the what the problem is. Is the formule that you share serves to same purpose ? and i do double click with using ctrl+l button so to go back i need a button. Thanks a lot for your support i am beginner

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •