listbox

reddcannon

Board Regular
Joined
Aug 11, 2011
Messages
118
I have a list box, all works fine, but after I select the item in the box I want, it will not let me tab out. I would like for it to tab to the next unprotected cell which is B11, but it will not let me tab out of it, I can move the mouse and get out, but not tab
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I am sorry to be so stupid, where do I put that, BElow is what I have already when I hit ALT + F11 or doe I put it somewhere in the list box


Private Sub CommandButton1_Click()
On Error Resume Next
Range("a4:q3366").Value = vbNullString
On Error GoTo 0
End Sub

Private Sub CommandButton2_Click()
Dim searchthis As String, Found As Range
Me.Unprotect Password:="123"
searchthis = InputBox("Type Number.", "Property Search")
searchthis = searchthis & "*"
Set Found = Range("A:A,c:c").Find(What:=searchthis, LookIn:=xlFormulas, LookAt:=xlWhole)
If Not Found Is Nothing Then Found.Select
Me.Protect Password:="123"
End Sub
Private Sub CommandButton3_Click()
Me.Unprotect Password:="123"
Application.Goto Range("a7"), True
Me.Protect Password:="123"
End Sub
 
Upvote 0
When talking about controls, say what type it is. It was assumed that it was a listbox control on a userform by VoG.

Your posted code had nothing to do with listbox controls.

For an ActiveX Listbox control, press the Esc key to escape back to cell before the control was clicked.

Rather than doing all of that protecting and unprotecting, doubleclick ThisWorkbook object in the Project Explorer of the VBE and paste this for just Sheet1:
Code:
Private Sub Workbook_Open()
  Sheet1.Protect "123", UserInterfaceOnly = True
End Sub
You can run the code to test if you don't want to close and open the workbook. Of course you can use this method for any other or all sheets.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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