+ Reply to Thread
Results 1 to 23 of 23

How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Dear Forum,

    I have a File which containts a lot of WorkBook and Moving to and Fro from in these WorkBooks becomes quite tedious and so thought of Making a Previous and Next Hyperlink in all the Sheets to go to the Next Sheet to the Right and the Previous to the Left of the Active Sheet in all Sheets and one common go Back to Index Hyperlink to take to the Index Sheet.

    is there a better way of achieving this without manually doing it between 60-70 Sheets.

    Please suggest some workarounds...

    Thanks in advance.

    Warm Regards
    e4excel

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hi e4excel,
    You are asking to different questions.
    If you have different "Workbooks" then these are different files on your harddrive or server.
    If you have different "Worksheets" then these are different tabs in a single workbook file.

    You have mixed these words in your question above.

    If you meant different TABS on a single WORKBOOK then you can use an index number to address the different Tabs or Worksheets.

    Worksheets(1) would be the first tab, on the very left of a workbook
    Worksheets(Worksheets.Count) would be the last tab, on the very right of the workbook.

    hope this helps.

    To answer the thread title is this. Your current worksheet number is "Activesheet.Index". So to access the sheet to the left is Worksheets(Activesheet.Indes - 1). And + 1 to get the worksheet to the right.
    Last edited by MarvinP; 03-31-2011 at 12:01 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    You could assign these two macros to shortcut keys (i.e. Ctrl+b and Ctrl+f ) so you could key your way thru the various sheets. You could also have a "Ctrl + i" that would activate the "index" sheet.

    Please Login or Register  to view this content.
    Last edited by nimrod; 03-31-2011 at 12:15 PM.

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Quote Originally Posted by MarvinP View Post
    Hi e4excel,
    You are asking to different questions.
    If you have different "Workbooks" then these are different files on your harddrive or server.
    If you have different "Worksheets" then these are different tabs in a single workbook file.

    You have mixed these words in your question above.
    Yes I did not realise that ..Yes I meant WorkSheets and not different WorkBooks..

    Sorry about that!

    Per your suggestion..

    So to access the sheet to the left is Worksheets(Activesheet.Indes - 1). And + 1 to get the worksheet to the right.

    What do I write and where?

    Like I was thinking of having 3 Hyperlinks in 3 Fixed Cells in the different SHeets to manoeuvre the Movement..

    So please tel me if the cells are A1,A2 and A3 what do I do and which event...

    I want these to show up in every sheet with the functionality to move to previous, next and Index Sheet..

    Thanks a lot for replying..

    Warm Regards
    e4excel
    Last edited by e4excel; 03-31-2011 at 05:19 PM.

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Quote Originally Posted by nimrod View Post
    You could assign these two macros to shortcut keys (i.e. Ctrl+b and Ctrl+f ) so you could key your way thru the various sheets. You could also have a "Ctrl + i" that would activate the "index" sheet.
    Dear Nimrod , I like your suggestion but I Intend to have Indicators like Arrows --> , <-- and Back To Index in the cells A1,A2,A3..

    then how would I do it and I want this logic replicated in all the Sheets except Index..

    So can you please make changes in the WorkSheet if I add one..

    Regards
    e4excel
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Another way:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Dear Members ,

    I think my Title is a little confusing digressing from the purpose..
    More than knowing I want to have some code or formula which is repeated in each Sheet and which can help manoeuvre to and fro in the WOrkBook..

    So knowing Names is secondary but the actual application was to get a Hyperlinked Stucture which can be copied or enabled with VBA on New Sheet Insertion in the WorkBook..

    Regards
    e4excel

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Please Login or Register  to view this content.

    Regards

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hi,

    Find the attached sheet with macros and QAT buttons to do as you now have explained.

    Your last post implied you wanted to add a new worksheet after the last. That was new to the original question. I haven't included code to do this.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Dear MarvinP,

    I am really sory for all the confusion owing to the Title..!

    I am not sure I could follow your instruction , I mean wheres the QAT with the TWO arrows..

    Dear TMShucks,

    ActiveSheet.Hyperlinks.Add _
    Anchor:=Range("A1"), _
    Address:="", _
    SubAddress:=ActiveSheet.Previous.Name, _
    TextToDisplay:="Go to " & ActiveSheet.Previous.Name

    Where do I add this code in the WOrkbook? May I please request just modify the worksheet so as to make it easier or me to understand as VBA is something I am just getting to learn of late.

    Regards
    e

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hi e4excel,
    The QAT is better known as the Quick Access Toolbar and are the Icon's above the Menu Bar on top of an Excel Window of File, Edit, View, Insert etc. See the picutre at http://www.rondebruin.nl/0307commands.htm

    I followed instructions given on this page: http://www.rondebruin.nl/imageqat.htm

    Above the word Insert on my QAT are now 2 new button Icons. One with a left pointing arrow, and one with a right pointing arrow. The code for these two buttons is in the Module in the VBA code of the attached workbook attached above.

    The way to do this is to first create a subroutine and then attach a QAT to the routine using the Custom Dropdown from the link above. You can see the code by opening the Visual Basic Viewer on the Developer Tab of your Excel program.

    I hope this lets you see how I would go about what I thing you are asking for. That was writing code that would go to the previous and next tab in a workbook, that would be available from any worksheet.

    Is that what you final question was?

  12. #12
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hello e4excel
    I'm really not understanding how having to scroll to A1 on a sheet and click an arrow is faster than excels built in methods of
    A) clicking on sheets tab that requires no scroll (i.e. next sheet)
    B) rt clicking on the bottom bars arrows and selecting from popup sheet list

    However I can see someone might want to use shortcut keys versus mousing sooo I've included sample of my ealier suggestion i.e.
    Ctrl + i = goto Index sheet
    Ctrl + f = Forward to next sheet
    Ctrl + b = Back one sheet

    BY-THE-WAY:
    You do know there is a built in Index of sheet ? i.e. if you right-click over the arrows in the lower left corner of excel sheet a sheet index will popup

    EXCELS DEFAULT PAGE NAVIGATION
    Move to the next sheet in the workbook. CTRL+PAGE DOWN
    Move to the previous sheet in the workbook. CTRL+PAGE UP
    http://office.microsoft.com/en-us/ex...005203781.aspx
    Attached Files Attached Files
    Last edited by nimrod; 03-31-2011 at 08:27 PM.

  13. #13
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Quote Originally Posted by nimrod View Post

    A) clicking on sheets tab that requires no scroll (i.e. next sheet)
    B) rt clicking on the bottom bars arrows and selecting from popup sheet list

    Ctrl + i = goto Index sheet
    Ctrl + f = Forward to next sheet
    Ctrl + b = Back one sheet

    BY-THE-WAY:
    You do know there is a built in Index of sheet ? i.e. if you right-click over the arrows in the lower left corner of excel sheet a sheet index will popup

    EXCELS DEFAULT PAGE NAVIGATION
    Move to the next sheet in the workbook. CTRL+PAGE DOWN
    Move to the previous sheet in the workbook. CTRL+PAGE UP
    Thanks a lot NIMrod,
    I like the approach you have mentioned of CTRL + I, B or F of all however the reason of Automating it was to go not only in the Sheet but also to a particular cell like H2 in all sheets after clicking..

    There are lot of Print-Outs to be taken from this SHeet and therefore wanted to make it easier for the person to move between SHeets.

    Actually, I didnt know about the default Index you and The KeyBoard ShortCuts mentioned..so grateful to you for the same,..

    If I am not asking too much can this code be placed in the Click or Double-Click Events of these three cells so that I can copy an replicate the same in several Sheets vy CTRL+SELECTING Al the Sheets..

    That would be twice as nice as getting the Functionality alongwith USER-FriendliNESS..

    Thanks a lot NimROd and MarvinP I am going through the Links you provided to assess which optin would better suit my requirement.

    SO thanks to both of you for the help..

    Regards
    e4excel

  14. #14
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    IS it Possible to use a Cells Click Event and then maybe adding NimRods Code to get the desired effect.

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Note that Ctrl-B and Ctrl-I are, by default, the shortcut keys for bold font and italic font respectively (across all Office applications). Your users may find this confusing if they use those shortcuts.

    Regards

  16. #16
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    So cant I have some cell click event to do the same so that I can have BACK & FORTH Arrows with the Name of the Prev and Next SHeet next to the Arrows and the functionlaity as well..

    This needs to be copiable as in replcative so that I can copy this in all the Sheets and it acts differently in each Sheet..

  17. #17
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    This really does seem to be alot of work when excel already has several built-in ways to navigate sheet i.e. ; click tab, short-cut keys, Custom View Menu , PopUp Sheet list .

    Then on top of that you must realize that your navigation feature will only work in vba enabled workbooks. So the arrows will be there but won't work if user does not enable macro's OR if the user saves the file as a xlsx. Now you going to get users calling you about the navigation arrows not work. Also these arrows are going to prevent the use of the cells they are located over/in.

    I really think you should re-think the idea.

  18. #18
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hey e,

    Nimrod is absolutely correct . Excel has most everything we need already and we as humans simply need to find how it does our work for us.

    A few years back I needed to filter a pivot table for a user programatically as he felt the Excel way was too complicated. I created this user interface instead of teaching him how to use the normal pivot table dropdown filters. It took days to figure out the code and the lists and the code. Now that he's learned how to use the standard method, he has a better understanding of how it works and more capabilities that I every wrote code for.

    YOU NEED to use the standard method of simply clicking on the tabs at the bottom of the workbook to change tabs. Left and Right become obvious when you can see which tab you are on. Why do you want to create another method/standard for doing something easy in excel when it is already there and easy to learn or teach.

  19. #19
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    There are lot of Print-Outs to be taken from this SHeet and therefore wanted to make it easier for the person to move between SHeets.

    Actually, I didnt know about the default Index you and The KeyBoard ShortCuts mentioned..so grateful to you for the same,..
    Dear MarvinP and NimROd,

    With Due Respect to both your views on Tab Movement, I would like to mention that I would have difinitely prefered the simple option but the reason for the requirement was to make it faster as the Pointer needs to be at a particular cell and which can be achieved with a HyperlInk but since HyperLinking several sheets was time-consuming thought of a better way to achieve that..

    Regards
    e

  20. #20
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hi e,

    I find this thread interesting. You ask how to know sheets Right or Left. We (a few of us) answer and you don't like our answers, because you want us to use Hyperlinks in our answer. I guess you want us to use Hyperlinks so you can land on the same cell when moving from sheet to sheet. Perhaps the Title needed to be. "How to create a hyperlink on sheets to move to sheet (Left or Right) and get to common cell".

    All we can do is try to answer your question based on our best experience. If you need to have it done in a very specific way using specific code, you might be looking for a contract programmer.
    Last edited by MarvinP; 04-01-2011 at 07:46 PM.

  21. #21
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hello e4excel;
    Please don't think I'm trying to "dis" you . I respect that you are learning and trying new things. I think that most people that get good at this stuff do exactly that. But with this project I think , in the long run , it's alot of effort for not much return. With that said have you looked at the built-in "custom views" ? Excel allows you to drag a "Custom Views" drop down menu onto you menu bar. You then select the cells , sheets and views (i.e. rows hidden etc) and then give that view a name in the drop down menu. Then the user just selects that view from the menu. In short your "index" would always be available on the tool bar.

    Good luck with you experimentation.

  22. #22
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Dear NimRod and MarvinP,

    I respect your views and completely agree with you that this is too simple a request to move between the tabs but the reason of asking for its is to Save the Time by taking the pointer to always a particular cell from where there the person can take control of the Sheet for Printing the Sheets contents which are already formatted for the Print Preview..

    Hope you understand..!

    I have tried to make up some code of my own with great help from the Forum and TMShucks inital code however theres something which is missing as I am getting an error mentioning that "REFERNCE IS NOT VALID"

    Please Login or Register  to view this content.
    Would appreciate if someone could just tweak a little..
    I think instead of the "ActiveSheet.Hyperlinks.Add _" it needs to be the Previous SHeet...


    Warm Regards
    e4excel
    Last edited by e4excel; 04-04-2011 at 07:56 AM.

  23. #23
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: How do I know which sheets are to the RIGHT and LEFT to the Active Sheet?

    Hello e4excel:
    You've mentioned that you want this to aid in printing multiple sheets at once.... do you realize excel already has the ability to do this ? You can select as many sheets as you want by using Shift + click or Ctl+ click then print all the sheets selected.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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