+ Reply to Thread
Results 1 to 5 of 5

find out original/previous worksheet name

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    30

    find out original/previous worksheet name

    Hi

    I encountered some problem, hope you can help me.
    I'm executing some macro by pushing a button in my worksheet.
    During the macro I'm activating another sheet in another xsl file and collecting data from it.
    at the end I need to go back to my original sheet(where the button located) and activate it to update a chart on this sheet.

    how can I recognize the name of the sheet, so I will be able to activate it at the end of the macro? or is there any other way to activate previous sheet?

    hope the problem is understandable.

    Thanks!
    Last edited by michael.g; 11-19-2009 at 07:23 AM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: find out original/previous worksheet name

    I am currently developing an awesome solution to this problem, please stand by.

  3. #3
    Registered User
    Join Date
    10-28-2009
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: find out original/previous worksheet name

    found how to do it

    ActiveWindow.ActivatePrevious


    thanks!

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: find out original/previous worksheet name

    The insinuation from your post is that your code activates other sheets (which is probably not necessary).

    If your code is on the worksheet in question, you can simply refer to 'me' e.g.:
    Please Login or Register  to view this content.
    but if you post your macro, it could probably be tidied up more thoroughly.

    CC

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: find out original/previous worksheet name

    You have not provided the code, so I will use a simple scenario.

    2 workbooks "Book1" and "Book2", you want to copy Book1,Sheet1,A1 and paste it to Book2,Sheet1,A1.
    With both workbooks open you would use the macro recorder and end up with a code like this, these codes will be in Book2
    Please Login or Register  to view this content.
    The following code will do the same thing without having to physically select Book1 to get the data.

    Please Login or Register  to view this content.
    This may work as well.

    Please Login or Register  to view this content.
    Last edited by davesexcel; 11-19-2009 at 08:02 AM.

+ 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