+ Reply to Thread
Results 1 to 4 of 4

Return to last active cell after a group of subs have been run

  1. #1
    Forum Contributor
    Join Date
    06-06-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    129

    Return to last active cell after a group of subs have been run

    Hi, all I am stuck again. I need to have my cursor on the worksheet I am working on to return to the last active entry cell when returning from a group of sub routines.

    I found the code on line but can’t seem to get it to work.

    Placed at the beginning of the sub:
    Please Login or Register  to view this content.
    Placed at the end of the Sub:

    Please Login or Register  to view this content.
    If I run:

    Please Login or Register  to view this content.
    Here is a copy of my Sub code:

    Please Login or Register  to view this content.
    Any and All help is appreciated and welcome. Thanks in advance for your help!

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Return to last active cell after a group of subs have been run

    Hi there,

    You don't need to select columns to set their widths so the following won't change the location of the active cell after it has been run:

    Please Login or Register  to view this content.
    Not sure why you're setting the District variable but then do nothing with it

    HTH

    Robert
    Last edited by Trebor76; 04-22-2019 at 07:16 PM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Contributor
    Join Date
    06-06-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    129

    Re: Return to last active cell after a group of subs have been run

    Thanks for your Help and Guidance!! That solved the problem and I have now learned the correct way to address the ".Columns" and "Cells." Functions in VBA. I have adapted your code to address some other "Cell" issues I had with using the "Select" command in cell formatting.

    As far as your question about the:

    Please Login or Register  to view this content.
    That was in there by mistake and does not have anything to do with the listed code. I got into a hurry and did not proof the submission close enough, good catch.

    Thanks again for your time and help! Have a great Day!

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Return to last active cell after a group of subs have been run

    I'm glad we were able to get it sorted for you. Thanks for marking the thread as solved and for the rep

+ 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. [SOLVED] Help with VB code to return the value of a cell based on the Active Cell selection
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2016, 10:16 AM
  2. Return the value of an active cell, dynamically
    By Brett Mercier in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-13-2015, 05:11 PM
  3. Module Subs executing Private Subs without prompt by code - Totally Lost
    By Ozan Ertem in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-26-2012, 05:31 PM
  4. Return active cell's location/row
    By rziegler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-09-2009, 05:29 PM
  5. Return to org active cell
    By thsam in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-05-2007, 11:43 AM
  6. Select active cell and return value
    By mabbutt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2007, 07:14 AM
  7. [SOLVED] How do I return which row the active cell is in?
    By Cloudfall in forum Excel General
    Replies: 20
    Last Post: 09-21-2005, 11:05 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