+ Reply to Thread
Results 1 to 3 of 3

TabStrip index values differ from MouseDown to MouseUp. Am I doing something wrong?

  1. #1
    Registered User
    Join Date
    11-25-2021
    Location
    Sande, Germany
    MS-Off Ver
    2019
    Posts
    8

    TabStrip index values differ from MouseDown to MouseUp. Am I doing something wrong?

    Hallo, Forum.
    I have a UserForm with a TabStrip of four tabs. I am finding that the index value passed on to the MouseDown Event is as I would expect (a digit between 0 and 3 depending on the tab being clicked). However, the MouseUp Event immediately following this always gives the index value as 0 whatever tab is clicked. I do not understand this. Would any kind soul like to explain?

    Greetings all round,

    Ken Wilson

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

    Re: TabStrip index values differ from MouseDown to MouseUp. Am I doing something wrong?

    I can't replicate that result. In the MouseDown event, the value of the tabstrip is the value of the current tab. In the MouseUp event the value of the tabstrip is the value of the new tab.

    I noticed you using the term index value. The .TabIndex of a Tabstrip, like the TabIndex of any control, it its index in the tab order of its surrounding container (userform, frame or page). It has nothing to do with the selection made by the user.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    11-25-2021
    Location
    Sande, Germany
    MS-Off Ver
    2019
    Posts
    8

    Re: TabStrip index values differ from MouseDown to MouseUp. Am I doing something wrong?

    Hi, mikerickson,

    Thanks for your reply. You're quite right, of course: I used an inappropriate term in my post. The index I was referring to was, as you rightly surmised, in fact the tabstrip.Value and had nothing to do with the tabstrip.TabIndex. The tabstrip.Value, however, if I understand things correctly, is passed on to the MouseDown/MouseUP event handlers under the guise of "By Val Index" and this is what I used in my simple boilerplate code "Select Case Index" -- Wait! Let me try something. BINGO! I changed the code to "Select Case tabstripname.Value" and the code now works like I remember it doing in earlier drafts.

    This clears up for me why a functioning code suddenly stopped working but my original question still stands, I'm afraid. I don't understand your reply. What "new tab" are you referring to? The "current tab" I take to be the tab clicked which fired the MouseDown event handler and this produced the expected result using "Select Case Index". Why should Case Index always = 0, then in the subsequent MouseUp handler? What has caused the value of By Val Index to be different?

    Thanks for your time,

    Ken Wilson
    Last edited by KenGWilson; 10-06-2022 at 09:02 AM. Reason: Bad typing

+ 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] INDEX returning wrong values
    By badat3xcel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-30-2020, 04:51 AM
  2. Index Match returning wrong values
    By CoachK88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-03-2018, 12:48 AM
  3. [SOLVED] Index Match function returning wrong values sometimes
    By Dord25 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2018, 09:18 PM
  4. Change TabStrip Name Values During Runtime
    By JonathanEngr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2016, 03:15 PM
  5. [SOLVED] Determine whether values in 3 cells differ by more than 20%
    By rndmwrd in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-25-2014, 10:56 PM
  6. [SOLVED] Help-> Index+Match formula pulling wrong values
    By sashafierce in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-29-2013, 07:13 PM
  7. MouseDown()-MouseUp()
    By skrol in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2005, 06:01 AM

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