+ Reply to Thread
Results 1 to 4 of 4

If...then help. Reselecting previously selected sheet

  1. #1
    Registered User
    Join Date
    12-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    If...then help. Reselecting previously selected sheet

    I have written the macro below, which looks in cells on a sheet that is selected and then if there is a 0 in the cell, will then select a different sheet and print it.

    The problem is that now the second sheet is selected, but I want to go back to the initially selected sheet and check the cells on that sheet. I have to do this within another macro so it would be easier if I could find a way to reselect the last selected sheet, rather than write a different macro for each sheet. Is there a way to do this?



    This macro is part of another macro, so at this point, sheet X is selected



    Please Login or Register  to view this content.


    '(so, now the sheet "GT bypass valves thermal checks" is selected, but I want to reselect sheet X now and continue to check the cells in that sheet)



    Please Login or Register  to view this content.
    Last edited by alansidman; 02-14-2014 at 10:19 AM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: If...then help. Reselecting previously selected sheet

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (Because you are new to the forum, I have added them for you today. Please read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: If...then help. Reselecting previously selected sheet

    You can save the location of a sheet then go back to it later.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: If...then help. Reselecting previously selected sheet

    This is perfect, thankyou!!

+ 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. Autocopy Cell From Previously Sheet?
    By MikiMix in forum Excel General
    Replies: 2
    Last Post: 01-17-2007, 11:31 AM
  2. Help with sebastienm's code - Returning To Previously Selected Worksheet
    By AcesUp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2006, 05:44 AM
  3. [SOLVED] Macro to concatenate previously selected cells
    By Grumpy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2005, 08:55 PM
  4. Clearing what you have previously selected
    By T8RSP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2005, 06:30 AM
  5. Lookup Oldest date from previously selected Group Data
    By Jim May in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-14-2005, 03:06 PM

Tags for this Thread

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