+ Reply to Thread
Results 1 to 12 of 12

.Select selecting multiple sheets in a form

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    .Select selecting multiple sheets in a form

    Hi,

    I have a form that is called from "Sheet1" with a button on it. When the user clicks the button, a function is called, the form is unloaded and "Sheet2" is selected.
    However, while "Sheet2" does get selected, "Sheet1" is also still selected, resulting in any new changes happening to both sheets.

    For example:
    Please Login or Register  to view this content.
    After this is run from "Sheet1", "Sheet2" is selected correctly. However, if I type something in cell A1 in "Sheet2", it also appears in cell A1 in "Sheet1", unless I manually deselect "Sheet1".

    I assume I'm doing something stupid but I've tried lots of different things with no success and have also searched for answers. From what I can tell .select should ensure only one worksheet is selected.

    Thanks,
    Kris

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: .Select selecting multiple sheets in a form

    Try

    Please Login or Register  to view this content.
    It looks like quitting the userform is making excel read the next line like:-

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 12-19-2014 at 09:25 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: .Select selecting multiple sheets in a form

    unloading the form before or after won't make a difference. Unloading it twice is redundant. There is something else going on with other code that is causing you issues.

  4. #4
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form

    Yeah, thanks mehmetcik, but I've tried that before and it didn't work unfortunately.

    Quote Originally Posted by stnkynts View Post
    unloading the form before or after won't make a difference. Unloading it twice is redundant. There is something else going on with other code that is causing you issues.
    The same thing happens if you create a brand new sheet with no other code.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: .Select selecting multiple sheets in a form

    How about
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form

    Quote Originally Posted by jindon View Post
    How about
    Please Login or Register  to view this content.
    Thanks, but no luck.

  7. #7
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form


  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: .Select selecting multiple sheets in a form

    I have downloaded the file and it is working correctly. No selection of Sheet1.

    Default "Replace" protocol of Select method is True, so it is not required anyway.

    I think you need to fix/re-install your Excel....

  9. #9
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form

    That's strange..
    I will do a re-install and report back.

  10. #10
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form

    After re-install:
    If you navigate cells with the keyboard, it still types in "Sheet1" and not "Sheet2". However, if you use the mouse to click on a cell in "Sheet2", it works as expected. Strange behaviour but I can live with it.
    However, if you use the button and then try and close Excel with the 'X' in the top right, it doesn't work for me. You have to change sheets for it to regain its ability.
    Again, not a huge problem but weird...

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: .Select selecting multiple sheets in a form

    Hummm, I can not replicate your problem here.
    Everything is fine....

  12. #12
    Registered User
    Join Date
    06-04-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    27

    Re: .Select selecting multiple sheets in a form

    That is bizarre!
    If it's just my computer then it doesn't really matter then I suppose. Thanks for the help.

+ 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] Form to select sheets and export as PDF
    By ron2k_1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-28-2012, 02:02 PM
  2. [SOLVED] selecting multiple sheets
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 09:05 PM
  3. [SOLVED] selecting multiple sheets
    By Shaun in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. [SOLVED] selecting multiple sheets
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 08:05 AM
  5. [SOLVED] selecting multiple sheets
    By Shaun in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

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