+ Reply to Thread
Results 1 to 15 of 15

Change Focus on Cell Select

  1. #1
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Change Focus on Cell Select

    I'm attempting to change the focus when you select a cell. This is what I have thus far, but it is not working. Any suggestions?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Change Focus on Cell Select

    Instead of:

    Please Login or Register  to view this content.
    How about:

    Please Login or Register  to view this content.

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

    Re: Change Focus on Cell Select

    Hi,

    Please explain what is supposed to be happening.

  4. #4
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    Thanks, StevenM, but that did not work.

    Dave, I want the focus to switch from cell Template!C18 to Ranges!C2 when you click on Template!C18.

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

    Re: Change Focus on Cell Select

    This should do it then
    Please Login or Register  to view this content.
    Place this in the "Template" worksheet module.

  6. #6
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Change Focus on Cell Select

    Copy and place in worksheet module "Template":


    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    Neither of those work either. Is there something I need to enable to make this happen? My security is set to allow Macros and I've not had problems previously getting code to work.

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

    Re: Change Focus on Cell Select

    The worksheet spelling has to be exact, and you need to place the code in the worksheet module.
    Right click on the "Template" sheet tab and select view code, paste the code there.

  9. #9
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    http://imgur.com/c5Hl8

    Posted the cell/worksheet names directly from Excel. Image of where I'm placing this code.

  10. #10
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Change Focus on Cell Select

    That looks correct. I'm at a loss here, the code worked for me.
    Last edited by StevenM; 05-07-2012 at 09:18 PM.

  11. #11
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    As am I because I just tested it on a black workbook and it worked fine...

    There's a formula in the target cell but I wouldn't think that'd be an issue.

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

    Re: Change Focus on Cell Select

    Your picture does not show the code I gave you.

  13. #13
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    No it shows Stevens. The image is merely to show where I'm placing the codes you are suggesting.

    I've tested both of your codes in a fresh workbook and they both work, which tells me the problem is not with the code but with the workbook.

    Attached is the workbook if you would like to take a look.
    Attached Files Attached Files
    Last edited by thesonofdarwin; 05-07-2012 at 09:31 PM.

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

    Re: Change Focus on Cell Select

    Nowhere did you mention that the target cell was a merged cell!!!
    Please Login or Register  to view this content.
    It is not good practice to use merged cells.

  15. #15
    Registered User
    Join Date
    10-13-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Change Focus on Cell Select

    Ugh, sorry for the headache! I know using merged cells is not ideal, but the format and required information on each page is set in stone for now. I have to work within those requirements.

    Thanks for the assistance, guys.

+ 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