+ Reply to Thread
Results 1 to 3 of 3

Macro to return to Current Sheet and Cell

  1. #1
    Steve Klenner
    Guest

    Macro to return to Current Sheet and Cell

    I have a macro that is used in several different areas in my workbook. The
    macro changes values in several sheets from the sheet I'm on...and that all
    works.

    I'd like the macro to return me to whatever active sheet and cell I am
    currently at....how can I accomplish this?

    Thanks
    Steve

    --


    ----------------------------------------------------
    This mailbox protected from junk email by MailFrontier Desktop
    from MailFrontier, Inc. http://info.mailfrontier.com



  2. #2
    William
    Guest

    Re: Macro to return to Current Sheet and Cell

    'Place this at the start of your macro.....

    Dim wb as workbook
    Dim ws as worksheet
    Dim c as range

    set wb=activeworkbook
    Set ws=wb.activesheet
    set c=activecell

    'Your code here

    'Place this at the end of your macro.....
    wb.activate
    ws.select
    c.select


    --


    XL2003
    Regards

    William
    [email protected]


    "Steve Klenner" <[email protected]> wrote in message
    news:%[email protected]...
    >I have a macro that is used in several different areas in my workbook. The
    >macro changes values in several sheets from the sheet I'm on...and that all
    >works.
    >
    > I'd like the macro to return me to whatever active sheet and cell I am
    > currently at....how can I accomplish this?
    >
    > Thanks
    > Steve
    >
    > --
    >
    >
    > ----------------------------------------------------
    > This mailbox protected from junk email by MailFrontier Desktop
    > from MailFrontier, Inc. http://info.mailfrontier.com
    >
    >




  3. #3
    Norman Jones
    Guest

    Re: Macro to return to Current Sheet and Cell

    Hi Steve:

    In Addition to William's suggestion, try amending your code to avoid sheet
    and range selections: most manipulation can be effected without making such
    selections.

    ---
    Regards,
    Norman



    "Steve Klenner" <[email protected]> wrote in message
    news:%[email protected]...
    >I have a macro that is used in several different areas in my workbook. The
    >macro changes values in several sheets from the sheet I'm on...and that all
    >works.
    >
    > I'd like the macro to return me to whatever active sheet and cell I am
    > currently at....how can I accomplish this?
    >
    > Thanks
    > Steve
    >
    > --
    >
    >
    > ----------------------------------------------------
    > This mailbox protected from junk email by MailFrontier Desktop
    > from MailFrontier, Inc. http://info.mailfrontier.com
    >
    >




+ 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