Mouse Wheel to Scroll Userform Textbox RRS feed

  • Question

  • Thanks in advance for any help...

    I have a userform named "Log".  On this form I have 3 textbox's which are populated from 3 different worksheets Titled "Midsbox", "Daysbox", "Swingsbox".  The properrty of the text boxes is set to multi line and does contain multiple lines.  Currently the only way to move up and down through the multiple lines is the scroll bar.  My question is this:  What code do I need to be able to use the mouse wheel in each of the 3 text boxes.  Each text box needs to scroll only when the mouse is in that text box.  They need do not need to move all at once.  Thanks


    Thursday, February 4, 2016 10:27 PM

All replies

  • Hi,

    I'd like to know some...
    1) What is your application for your VBA?  Excel, Word???
    2) I cannot understand the meaning of
       "3 textbox's which are populated from 3 different worksheets Titled "Midsbox", "Daysbox", "Swingsbox".
       Would you explain further detail?  (I'm a Japanese, poor at English) 
    3) If the mouse is not in a text box, how can we identify the text box to be scrolled?
    4) I'll be happy, if you will share your file via cloud storage, such as OneDrive, Dropbox, etc.


    Friday, February 5, 2016 3:22 AM
  • The userform is named "Log"

    The three text boxes on the userform are named "Midsbox", "Daysbox", and "SwingsBox"

    All three text boxes are set to multi line and vertical scroll bars are visible. 

    I am just look for a way to scroll through the lines in each text box using the mouse wheel.  

    DropBox Link: 

    I have entered some lines into the 02/06/2016 so you could have a better idea.


    Friday, February 5, 2016 9:35 AM
  • Hi,

    Thanks. I could download your file and open it.
    But still I cannot understand your description.
    "scroll through the lines in each text box"... what does it mean?

    Friday, February 5, 2016 10:07 AM
  • Userform controls don't support wheel scroll. With APIs and a 'hook' some controls can be scrolled but not a textbox, at least not directly. What you could do is make the textbox full size to accomodate your text (set its width then AutoSize after adding the text), put it in a Frame control sized as you want and scroll the Frame. A fair amount of work to do though, even then a bit risky unless you know exactly what you're doing!

    Friday, February 5, 2016 11:06 AM