combobox scroll down enabled

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Vog sir this the new post.:-D

In Combobox there are multiple values i have it.
i had try to enable the scrol property of combo...see below
With Worksheets("Sheet4").ComboBox1
.SmallScroll Down:=True

but this gives me error - run time 438 , object dosent support.

Can this possble....to scroll down enable?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Where, in Excel? There's some sort of preview at that link I gave you which doesn't seem to work, but the file you can download from that page should work in Excel. Maybe you could post a link to screenshot of what it looks like in Excel, here's what I get:

scrollable-combobox-dropdown.jpg
 
Upvote 0
Sorry, I did download the file, and it worked beautifully. The scroll mouse worked great! But the code I copied from previous threads bomb out at first statement.

Thnx

Mitch
 
Upvote 0
Sorry, I did download the file, and it worked beautifully. The scroll mouse worked great! But the code I copied from previous threads bomb out at first statement.

Thnx

Mitch

Glad you got it sorted out. Yes, I would build on that working example if I were you, and keep a working backup file before you make any changes. I also litter my code with comments to remind myself of what I was thinking!

Good luck!
 
Upvote 0
Hi Jaafar, To add to this would you have an additional code to include all combo boxes (I have 150 boxes) rather than entering each code separately.

Cheers

Rod
 
Upvote 0
I think the OP wants to scroll the ComboBox list with the mouse wheel.

Unfortunatly the mouse wheel srolling doesn't work for ActiveX Listboxes and combos - when you try to scroll the drop down list with the mouse wheel it is the worksheet that scrolls not the drop down.

Here is this generic MakeScrollableWithMouseWheel Property i wrote to work around this limitation.

...

Dear Jaafar,

I've been using the code you gave earlier on this thread for a long time now and it's just worked great - but now the company I've worked for have given me a brand new 64 Bit laptop and that seems to have broken things, somewhat.

I got the following message when I opened the workbook:

VBA Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute

While I've read up on that and can understand a little about why it's happening I'm not really skilled enough to fix it, so I've simply removed your code and gone back to not being able to scroll the combo boxes on my worksheet.

Would it be possible for you to update your code to work on x64 systems? Please? Or just give me a little hint to start me off. The compile error pointed me to the incompatible code which was now marked in red, where it had all the 32 bit dlls shown. I think everything else is ok, just this section:

Code:
[COLOR=#b22222]Private Declare Sub CopyMemory Lib "kernel32" _
Alias "RtlMoveMemory" _
(ByVal Destination As Long, _
ByVal Source As Long, _
ByVal Length As Long)

Private Declare Function FindWindow Lib "user32.dll" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowsHookEx Lib _
"user32" _
Alias "SetWindowsHookExA" _
(ByVal idHook As Long, _
ByVal lpfn As Long, _
ByVal hmod As Long, _
ByVal dwThreadId As Long) As Long

Private Declare Function CallNextHookEx Lib "user32" _
(ByVal hHook As Long, _
ByVal nCode As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Declare Function UnhookWindowsHookEx Lib "user32" _
(ByVal hHook As Long) As Long

Private Const HC_ACTION = 0
Private Const WH_MOUSE_LL = 14
Private Const WM_MOUSEWHEEL = &H20A
Private Const GWL_HINSTANCE = (-6)

Private uParamStruct As MSLLHOOKSTRUCT
Private oObject As Object
Private lLowLevelMouse As Long
Private bHooked As Boolean
[/COLOR]
 
Upvote 0
Dear Jaafar,

I've been using the code you gave earlier on this thread for a long time now and it's just worked great - but now the company I've worked for have given me a brand new 64 Bit laptop and that seems to have broken things, somewhat.

I got the following message when I opened the workbook:



While I've read up on that and can understand a little about why it's happening I'm not really skilled enough to fix it, so I've simply removed your code and gone back to not being able to scroll the combo boxes on my worksheet.

Would it be possible for you to update your code to work on x64 systems? Please? Or just give me a little hint to start me off. The compile error pointed me to the incompatible code which was now marked in red, where it had all the 32 bit dlls shown. I think everything else is ok, just this section:

Hi Maximus ,
I am afraid I don't have a 64 bit machine in order to test the code after editing it .. I recommend you take a look here .. It shouldn't be difficult to make the necessary changes to the initial code
Regards.
 
Upvote 0
Hi Maximus ,
I am afraid I don't have a 64 bit machine in order to test the code after editing it .. I recommend you take a look here .. It shouldn't be difficult to make the necessary changes to the initial code
Regards.

Thanks for the quick reply and the link Jaafar. I'm busy making sure all my other Workbooks are ok at the moment, but I'll certainly be reading that web page and having a go at fixing it in the coming days. I'll post any successful revised code here.
 
Upvote 0
I'm stuck. I have downloaded the example sheet ComboMouseWheel.xls and the mouse scrolls fine. I cannot get the scroll to work in my worksheet. I have even gone as far as to export basMain and Sheet 1 from ComboMouseWheel.xls and imported them into my project. I have created a new combobox1 and populated it with a list. I have compared the two files ComboMouseWheel and my project and cannot find any differences. Ive even compared the ComboBox1 properties and they are the same.

So I am lost. The example sheet works, but my project does not.

The only symptom is that the mouse no longer scrolls in the VBA for Applications Editor. I get no errors, scrolling remains unavailable in the ComboBox.

Is there some small detail I am missing to enable mouse scrolling in VBA? Or have I missed the entire train?

Craig
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,459
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top