+ Reply to Thread
Results 1 to 14 of 14

Worksheet Focus - when selecting command button

  1. #1
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Worksheet Focus - when selecting command button

    Hello,

    When the command button is selected to open a worksheet in the workbook, the sheet opens but does not have the focus - it is behind the main sheet that the command button is on - how do i get the sheet that was needed to be the focus when selecting the command button

    Best Regards,

    John
    Last edited by JJFletcher; 11-05-2014 at 10:08 AM.

  2. #2
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Worksheet Focus - when selecting command button

    Add the Line:

    Please Login or Register  to view this content.
    to the Command Button.

    "Sheet2" is the sheet you are opening.
    If the solutions provided within this Thread takes care of your question:

    Please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

    You can also click on * (star) Add Reputation to add reputation to those who have put their time and efforts to help you in this Thread.

    This is another way to say Thank You to them.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,502

    Re: Worksheet Focus - when selecting command button

    What do you mean by "open a worksheet" and "it is behind the main sheet"?

    Post your code or, better, a sample workbook with it in situ.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    I have a spreadsheet that has a command button on it that when selected - opens another spreadsheet - once selected - that sheet does open - but it does not have focus - the spreadsheet that has the command button is visible and I want the 2nd spreadsheet to be visible

    Thanks

  5. #5
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Worksheet Focus - when selecting command button

    Opens a Spreedsheet in the same Workbook or in a new WorkBook?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,502

    Re: Worksheet Focus - when selecting command button

    So, by spreadsheet, do you mean workbook? Like I said, post your code.

  7. #7
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Worksheet Focus - when selecting command button

    The Only way you would not have Focus is if the Command button is on a Userform?? Or?

    If this is the case then just add the
    Please Login or Register  to view this content.
    as the last line in the command button.

    If the Command button is on the Sheet then you Focus on the new WorkSheet/WorkBook.

  8. #8
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    command button is on the spreadsheet - not a userform

  9. #9
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    My applogies - I am at work and will post the sample later Be back soon!

  10. #10
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    hello - I have returned - it's simple ---

    I have a spreadsheet that has a command button on it that when selected - opens another spreadsheet in the same workbook - once selected - that sheet does open - but it does not have focus - the spreadsheet that has the command button is visible and I want the 2nd spreadsheet to be in front of the spreadsheet that opened the 2nd sheet

  11. #11
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Worksheet Focus - when selecting command button

    Post the code.

    Part of our difficulty in understanding your problem is that "spreadsheet" is imprecise. Are you opening a different workbook or a different worksheet in the same workbook.

    Post the code.
    Or attach you workbook.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  12. #12
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    different worksheet in the same workbook

  13. #13
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    Here is the sample workbook requested

    TestSample.xlsm

    John
    Last edited by JJFletcher; 11-06-2014 at 01:41 AM.

  14. #14
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Worksheet Focus - when selecting command button

    Does this upload explain? - The second sheet I want to have the focus when opened

+ 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. setting focus with click of command button
    By shakey775 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-28-2012, 01:38 AM
  2. Command button problem on lost focus
    By rede96 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2010, 01:28 AM
  3. Focus on Command Button with Tab
    By ronjwil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2010, 12:20 PM
  4. Command Button to be used as Browse... for selecting a file to be used...
    By RPIJG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2005, 02:05 PM
  5. Option Button/Focus Problem on Worksheet
    By Resume Next in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2005, 09:05 PM

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