Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: VBA To Scroll Through ListBox Using Mouse Scroll Wheel

  1. #11
    Member
    Join Date
    Jul 2013
    Posts
    40
    Rep Power
    0
    Rick I am feeling very proud at the moment since my limited vba knowledge has inspired you of making an entire new thread
    with reference to my question and moreover providing your own work which is an entirely different approach but it might be
    more helpful than my own solution, that actually mimics functionality already built-in at newer office versions.
    Now that I think about it the only better thing in my replication is that I have made the font a little bit bigger to see ... lol

    If you don't mind I will embed the form in my addon. Is it ok with you?
    Keep in mind all vba I know has been googled...

  2. #12
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by MrBlackd View Post
    Now that I think about it the only better thing in my replication is that I have made the font a little bit bigger to see ... lol
    Hmm, you raise an interesting point. I have kept my monitors set to a height of 768 pixel (over the years the width has varied from 1024 to 1366 pixels) because that makes the screen more readable to me given my eyesight, but I'm guessing you, like probably the vast majority of people, use the higher resolutions available on their monitors. That, in turn, affects the display size of the UserForm I designed (more pixels means smaller pixels which means physically smaller UserForms). I might look into modifying the code in my "Go To Sheet" selector UserForm so it dynamically sizes the UserForm to the monitor's display setting. To help me in trying to do that, could you tell me what display size your monitor is set at (you should be able to get that from Windows Control Panel via its Display applet)? Also, what font size did you use for the UserForm you used in your UserForm?


    Quote Originally Posted by MrBlackd View Post
    If you don't mind I will embed the form in my addon. Is it ok with you?
    Of course I do not mind... anything I post in my sub-Forum, or in answers to any online questions (whether in this Forum or others that I volunteer at), is done so with the hope that readers may find a use for them in their own work.
    Last edited by Rick Rothstein; 06-01-2014 at 08:17 PM.

  3. #13
    Member
    Join Date
    Jul 2013
    Posts
    40
    Rep Power
    0
    Quote Originally Posted by Rick Rothstein View Post
    Hmm, you raise an interesting point. I have kept my monitors set to a height of 768 pixel (over the years the width has varied from 1024 to 1366 pixels) because that makes the screen more readable to me given my eyesight, but I'm guessing you, like probably the vast majority of people, use the higher resolutions available on their monitors. That, in turn, affects the display size of the UserForm I designed (more pixels means smaller pixels which means physically smaller UserForms). I might look into modifying the code in my "Go To Sheet" selector UserForm so it dynamically sizes the UserForm to the monitor's display setting. To help me in trying to do that, could you tell me what display size your monitor is set at (you should be able to get that from Windows Control Panel via its Display applet)? Also, what font size did you use for the UserForm you used in your UserForm?

    Of course I do not mind... anything I post in my sub-Forum, or in answers to any online questions (whether in this Forum or others that I volunteer at), is done so with the hope that readers may find a use for them in their own work.
    As you can imagine like the most of those that are dealing with vba I usually have multiple monitors, i.e. in my work laptop I have 1366x768 analysis while in the external monitor that I have plugged at work I have 1680x1050. At home I have a different monitor and the display is different (I can't tell you right now since I am at work, I will edit this post later to give you this info as well for your testing purposes...)

    Also due to multiple displays I have added to the form the following code to make it appear in the display that excel is currently placed (actually I am using this code in all forms that I add ...)

    Code:
    Private Sub UserForm_Activate()
        
    With Me
      .StartUpPosition = 0
      .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
      .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
    End With
       
    End Sub
    I think that it would be handy to have this added in your code...

    Finally I have used Tahoma 11 font in my userform listboxes and I have also changed your listboxes to this setting in order to have a consistency....
    Closing (although not necessary), thanks for your permission....
    Keep in mind all vba I know has been googled...

  4. #14
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by MrBlackd View Post
    As you can imagine like the most of those that are dealing with vba I usually have multiple monitors, i.e. in my work laptop I have 1366x768 analysis while in the external monitor that I have plugged at work I have 1680x1050. At home I have a different monitor and the display is different (I can't tell you right now since I am at work, I will edit this post later to give you this info as well for your testing purposes...)

    Also due to multiple displays I have added to the form the following code to make it appear in the display that excel is currently placed (actually I am using this code in all forms that I add ...)

    Code:
    Private Sub UserForm_Activate()
        
    With Me
      .StartUpPosition = 0
      .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
      .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
    End With
       
    End Sub
    I think that it would be handy to have this added in your code...

    Finally I have used Tahoma 11 font in my userform listboxes and I have also changed your listboxes to this setting in order to have a consistency....
    Closing (although not necessary), thanks for your permission....
    Thank you so much for your suggestions... I have incorporated them into my code in the "A Neat "Go To Sheet" Selector" thread (see Message #3 in that thread for my acknowledgement to you).

  5. #15
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    I posted my suggestion to this question here: A Neat "Go To Sheet" Selector

Similar Threads

  1. Mouse Scroll in Userform using Excel VBA 7
    By fenilbhoot in forum Excel Help
    Replies: 1
    Last Post: 10-15-2013, 12:49 PM
  2. Sort data sheet by right_click of mouse
    By Rasm in forum Excel and VBA Tips and Tricks
    Replies: 3
    Last Post: 12-08-2012, 07:34 PM
  3. Left and Right Mouse Click Event
    By PcMax in forum Excel Help
    Replies: 10
    Last Post: 11-24-2012, 04:54 AM
  4. Adding Scroll bar to image box in vba
    By princ_wns in forum Excel Help
    Replies: 1
    Last Post: 12-13-2011, 09:47 PM
  5. Scroll Lock and Unlock using VBA
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 11-08-2011, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •