+ Reply to Thread
Results 1 to 3 of 3

Relative return to original worksheet in middle of macro

  1. #1

    Relative return to original worksheet in middle of macro

    Hi -

    I'm making a macro that is used for many workbooks that will all have a
    different worksheet names (sheet, sheet2, etc...). The macro creates
    two new worksheets then it needs to return to the original worksheet to
    perform an action. So right in the middle of the macro, it needs to
    return to the original worksheet but that worksheet will always have a
    different name - is there anyway to do that? I couldn't find it or
    figure it out - I thought there was just some easy command, maybe?

    Thanks
    A


  2. #2
    Tom Ogilvy
    Guest

    RE: Relative return to original worksheet in middle of macro

    Dim sh as Worksheet
    set sh = Activesheet

    . . .

    ' now return to original sheet
    sh.Activate

    --
    Regards,
    Tom Ogilvy


    "[email protected]" wrote:

    > Hi -
    >
    > I'm making a macro that is used for many workbooks that will all have a
    > different worksheet names (sheet, sheet2, etc...). The macro creates
    > two new worksheets then it needs to return to the original worksheet to
    > perform an action. So right in the middle of the macro, it needs to
    > return to the original worksheet but that worksheet will always have a
    > different name - is there anyway to do that? I couldn't find it or
    > figure it out - I thought there was just some easy command, maybe?
    >
    > Thanks
    > A
    >
    >


  3. #3

    Re: Relative return to original worksheet in middle of macro

    Thanks much.


    Tom Ogilvy wrote:
    > Dim sh as Worksheet
    > set sh = Activesheet
    >
    > . . .
    >
    > ' now return to original sheet
    > sh.Activate
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "[email protected]" wrote:
    >
    > > Hi -
    > >
    > > I'm making a macro that is used for many workbooks that will all have a
    > > different worksheet names (sheet, sheet2, etc...). The macro creates
    > > two new worksheets then it needs to return to the original worksheet to
    > > perform an action. So right in the middle of the macro, it needs to
    > > return to the original worksheet but that worksheet will always have a
    > > different name - is there anyway to do that? I couldn't find it or
    > > figure it out - I thought there was just some easy command, maybe?
    > >
    > > Thanks
    > > A
    > >
    > >



+ 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