+ Reply to Thread
Results 1 to 5 of 5

Returning user to the starting cell

  1. #1
    Registered User
    Join Date
    10-20-2005
    Location
    Ithaca, NY, USA
    MS-Off Ver
    2004 for Mac
    Posts
    63

    Returning user to the starting cell

    This has got to be a very basic question, my apologies. I've been banging my head for over an hour about it, though.

    I have a macro that performs a conversion on many cells. What I want it to do is to remember where the active cell was when the macro started and return the active cell to the same place when the macro concludes. I need to do this for a single sheet when the conversion is performed on a single worksheet and to do this on an entire workbook when the conversion is performed that way. Say, for example, the active cell was B5 on worksheet 7 when the user clicked the conversion button, I want to return it to B5 on worksheet 7 when it is done.

    Again, my apologies for troubling you with something I should be able to figure out myself.

    ctap

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Hi

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    10-20-2005
    Location
    Ithaca, NY, USA
    MS-Off Ver
    2004 for Mac
    Posts
    63

    Thank you!

    Yes, that helps very much!

    Sorry for troubling you--I haven't done any coding in about a year and a half, I was up late and then woken early, so the brain was not about to find what I needed. My thanks for your quick response!

    ctap

  4. #4
    Registered User
    Join Date
    10-20-2005
    Location
    Ithaca, NY, USA
    MS-Off Ver
    2004 for Mac
    Posts
    63

    And how do I save the current worksheet? ^_^;;;

    I've been trying to get the macro to return to the original worksheet when I run the macro across all the worksheets in the workbook, but I can't seem to get a variable that works. I've tried defining currentsheet as a string and then setting currentsheet to ActiveWorksheet.Name, I've tried defining currentsheet as an integer or as Long and setting currentsheet to ActiveWorksheet.Index, I've tried defining currentsheet as a Worksheet object and setting currentsheet to ActiveWorksheet. Most of these get me a 424 error.

    Again, I'm sure I'm missing something basic, but I really have tried to figure it out for myself. My apologies that I'm not able to do even this much.

    ctap

  5. #5
    Registered User
    Join Date
    10-20-2005
    Location
    Ithaca, NY, USA
    MS-Off Ver
    2004 for Mac
    Posts
    63

    D'Oh!

    ActiveSheet, not ActiveWorksheet. My brain is clearly second-rate.

    It works now. Thank you for your patience.

    ctap

+ 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