+ Reply to Thread
Results 1 to 4 of 4

Go back to previous displayed screen

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Go back to previous displayed screen

    Hello,

    I am running a code which writes in a certain cell the current active cell address and after that it navigates to a far distant area of the same worksheet.

    Next I am running a different code which reads the cell address recorded earlier and selects it, in expectation that I would get back to the screen display I quit but what I am getting is the cell selected but not the display I had when I navigated away from the cell; I am just getting a portion of the earlier screen.

    Is there a way to return to the last display instead of just returning to the last cell?

    Please advise.

    Thank you

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Go back to previous displayed screen

    Can you show your code that stores the activecell address and later goes back to it?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Go back to previous displayed screen

    Hello AlphaFrog,
    Here are the codes:
    Sub Store()   
        ActiveWindow.FreezePanes = False
        ActiveSheet.Range("LastCell").Value = ActiveCell.Address
        Application.Goto Range("StartCateg"), Scroll:=True
    End Sub
    Sub GoBack()
    Dim LastCellAddress As String   
        LastCellAddress = ActiveSheet.Range("LastCell").Value
        Application.Goto (ActiveSheet.Range(LastCellAddress))       
    End Sub
    Thanks for looking into this!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Go back to previous displayed screen

    Public SR As Long
    Public SC As Long
    
    Sub Store()
        ActiveWindow.FreezePanes = False
        SR = ActiveWindow.ScrollRow
        SC = ActiveWindow.ScrollColumn
    End Sub
    
    Sub GoBack()
        If SR > 0 And SC > 0 Then
            ActiveWindow.ScrollRow = SR
            ActiveWindow.ScrollColumn = SC
        End If
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I scroll through a spreadsheet while displayed on a TV Screen?
    By hybidder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2016, 06:02 AM
  2. Change how spreadsheet is displayed on screen
    By LuckyMan in forum Excel General
    Replies: 7
    Last Post: 07-10-2012, 02:26 PM
  3. Excel Formula Displayed off screen!
    By hutch1062 in forum Excel General
    Replies: 0
    Last Post: 08-13-2010, 12:08 PM
  4. Replies: 0
    Last Post: 08-04-2006, 12:15 PM
  5. [SOLVED] Changing Hyperlinks Displayed Text Back
    By Ed in forum Excel General
    Replies: 1
    Last Post: 06-22-2006, 05:25 AM
  6. [SOLVED] Why do cells in Excel print shorter than displayed on-screen?
    By Mary Madeline in forum Excel General
    Replies: 0
    Last Post: 10-21-2005, 03:05 PM
  7. [SOLVED] Amount of Data in a Cell Displayed On Screen/Print
    By James H in forum Excel General
    Replies: 3
    Last Post: 04-27-2005, 02:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1