+ Reply to Thread
Results 1 to 8 of 8

Go back to previous active sheet

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Go back to previous active sheet

    Need a macro to jump back to previous active sheet. If I m on Sheet3 and go to Sheet7 i can run the macro and go back to sheet3. Next i would like to assign shortcut key and add the macro button to Quick Access toolbar so that i can use the macro on all workbooks.

  2. #2
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Go back to previous active sheet

    Record your macro what actions you want to do to switch sheets... then browse google for Customizing the Ribbon and add your macro

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Go back to previous active sheet

    previous active sheet can be different everytime

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Go back to previous active sheet

    To Add Excel VBA Code to a Workbook / This Workbook Module

    1. Copy the code that you want to use
    2. Select the workbook in which you want to store the code
    3. Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    4. In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    5. Right-click on the ThisWorkbook object, and choose View Code
    6. Where the cursor is flashing, choose Edit | Paste

    Please Login or Register  to view this content.
    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Go back to previous active sheet

    Post your current Excel Data sheet....,,,,

    Click Go Advanced and click on paper icon and browse, select and upload....

  6. #6
    Registered User
    Join Date
    08-30-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Go back to previous active sheet

    Thanks. Sixthsense. ur code works fine on a single workbook. but i want to use it as an Addin so that i can use it on all workbooks

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Go back to previous active sheet

    Quote Originally Posted by gopal baheti View Post
    I want to use it as an Addin so that i can use it on all workbooks
    Then it requires Class Module level of coding I believe, and I don't have that much of expertization

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Go back to previous active sheet

    You don't need a Class module (*cough*) or an Add-In.

    If you put this in the ThisWorkbook code module of your PersonalMacroWorkbook, the sub BounceBack will return you to the most recently used worksheet from any open workbook to any open workbook.

    After copy pasting, it will not work until you close your Excel and re-open it. Edit the short-cut key to your taste.

    Please Login or Register  to view this content.
    (*cough*) ThisWorkbook, sheet and user form code modules are all code modules of Objects and can accept the kind of coding that a Class Module can take. In a sense, the built in Excel object code modules are Class modules.
    Last edited by mikerickson; 12-02-2014 at 09:47 PM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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. [SOLVED] back to previous active sheet ?
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2014, 04:45 PM
  2. Macro to go back to the last active sheet and hide the active sheet
    By yatahaze in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2014, 08:18 AM
  3. Replies: 1
    Last Post: 07-07-2014, 09:19 AM
  4. [SOLVED] Go back to previous active sheet (Excel 2007)
    By JawD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2012, 08:00 AM
  5. Hyperlink refers back to previous sheet?
    By simonwilliams in forum Excel General
    Replies: 8
    Last Post: 12-09-2009, 07:23 AM

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